From 0ffa4b544099f8e1777013c47b1c082aafc6c984 Mon Sep 17 00:00:00 2001 From: Sorin Marta Date: Thu, 29 Oct 2026 11:21:49 +0200 Subject: [PATCH 1/2] Encode submit listing page data with JSON_HEX_TAG Fixes Strategy11/awpcp#3177 Stops Jetpack Boost's deferral from breaking the Place Ad and Edit Ad forms. --- includes/frontend/class-edit-listing-page.php | 2 +- .../submit-listing-page/listing-information-step.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/frontend/class-edit-listing-page.php b/includes/frontend/class-edit-listing-page.php index 4360765b1..2c89747c2 100644 --- a/includes/frontend/class-edit-listing-page.php +++ b/includes/frontend/class-edit-listing-page.php @@ -178,7 +178,7 @@ private function do_listing_information_step() { 'mode' => 'edit', ]; - return $this->render( 'content', '
' ); + return $this->render( 'content', '
' ); } /** diff --git a/templates/frontend/submit-listing-page/listing-information-step.tpl.php b/templates/frontend/submit-listing-page/listing-information-step.tpl.php index 3626d1cea..076fd8ab2 100644 --- a/templates/frontend/submit-listing-page/listing-information-step.tpl.php +++ b/templates/frontend/submit-listing-page/listing-information-step.tpl.php @@ -11,4 +11,4 @@ awpcp_listing_form_steps_componponent()->show( $current_step, compact( 'transaction' ) ); } -?>
+?>
From 601ced023d20da1fac19c94bed097d9fdfa3e6ee Mon Sep 17 00:00:00 2001 From: Sorin Marta Date: Thu, 29 Oct 2026 11:33:29 +0200 Subject: [PATCH 2/2] Replace finfo_close() and imagedestroy() with unset() Both functions have been no-ops since PHP 8.0 and are deprecated in PHP 8.5, which fails the PHPCS inspection. --- includes/functions/deprecated.php | 3 +-- includes/media/class-mime-types.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/functions/deprecated.php b/includes/functions/deprecated.php index 955f4177a..3e6c3a9c3 100644 --- a/includes/functions/deprecated.php +++ b/includes/functions/deprecated.php @@ -830,8 +830,7 @@ function awpcp_resizer($filename, $dir) { break; } - imagedestroy($src); - imagedestroy($tmp); + unset( $src, $tmp ); return true; } diff --git a/includes/media/class-mime-types.php b/includes/media/class-mime-types.php index 65e5aa26c..82131fc95 100644 --- a/includes/media/class-mime-types.php +++ b/includes/media/class-mime-types.php @@ -39,7 +39,7 @@ private function get_file_mime_type_with_fileinfo( $filepath ) { $fileinfo = finfo_open( defined( 'FILEINFO_MIME_TYPE' ) ? FILEINFO_MIME_TYPE : FILEINFO_MIME ); $mime_type = finfo_file( $fileinfo, $filepath ); $mime_type_parts = explode( ';', $mime_type ); - finfo_close( $fileinfo ); + unset( $fileinfo ); return array_shift( $mime_type_parts ); }