Fix unserialize() warning flood with PHP 8.3+. Fix deprecated warnings.#385
Conversation
As of PHP 8.3 unserialize() triggers E_WARNING instead of E_NOTICE causing SRDB to dump thousands of notices to the screen as it tries to unserialized non-serialized strings. It now checks for serialized data before trying to unserialize. Fixed Deprecation warning creating dynamic property: alter_collation. Fixed Deprecation warning when passing null to htmlentities().
Added v4.1.4 for unserialize() and Deprecated warning fixes.
There was a problem hiding this comment.
Yesterday I was using SRDB V4.1.3 running on the latest PHP version and encountered this problem. I have tested @colinfoster solution and it works perfectly!
Slamik
left a comment
There was a problem hiding this comment.
Tested on PHP 8.3 - everything works well!
|
8.3.9 works fine. Noticed the merge and review went unanswered here so people wanting these changes ( thanks to @colinfoster via #385 ) should grab the updates over @ https://github.com/colinfoster/Search-Replace-DB/ |
|
This fatal errors if you use composer and include "interconnectit/search-replace-db" with wordpress. I dont think its a good idea to be declaring is_serialized in global scope. Pull request to make class method and not pollute the global namespace here #397 Fatal error: Cannot redeclare is_serialized() (previously declared in /app/vendor/interconnectit/search-replace-db/srdb.class.php:1386) in /app/web/wp-includes/functions.php on line 669 Fatal error: Uncaught Error: Call to undefined function wp_die() in /app/web/wp-includes/class-wp-fatal-error-handler.php:245 |
As of PHP 8.3 unserialize() triggers E_WARNING instead of E_NOTICE causing SRDB to dump thousands of notices (one for every string checked) to the screen as it tries to unserialize non-serialized strings. It now checks for serialized data before trying to unserialize.
Fixed Deprecation warning creating dynamic property: alter_collation.
Fixed Deprecation warning when passing null to htmlentities().