Do not assume is set in the array.

This commit is contained in:
barryhughes 2023-03-27 13:21:25 -07:00
parent 03ebff86b8
commit c567a679b5
1 changed files with 2 additions and 2 deletions

View File

@ -169,7 +169,7 @@ class Reviews {
*/
private function handle_edit_review(): void {
// Don't interfere with comment functionality relating to the reviews meta box within the product editor.
if ( sanitize_text_field( wp_unslash( $_POST['mode'] ) ) === 'single' ) {
if ( sanitize_text_field( wp_unslash( $_POST['mode'] ?? '' ) ) === 'single' ) {
return;
}
@ -241,7 +241,7 @@ class Reviews {
*/
private function handle_reply_to_review() : void {
// Don't interfere with comment functionality relating to the reviews meta box within the product editor.
if ( sanitize_text_field( wp_unslash( $_POST['mode'] ) ) === 'single' ) {
if ( sanitize_text_field( wp_unslash( $_POST['mode'] ?? '' ) ) === 'single' ) {
return;
}