Skip to content

Fix unserialize() warning flood with PHP 8.3+. Fix deprecated warnings.#385

Merged
interconnectitalfie merged 2 commits into
interconnectit:masterfrom
colinfoster:master
Jan 31, 2025
Merged

Fix unserialize() warning flood with PHP 8.3+. Fix deprecated warnings.#385
interconnectitalfie merged 2 commits into
interconnectit:masterfrom
colinfoster:master

Conversation

@colinfoster

Copy link
Copy Markdown
Contributor

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().

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.

@mikecollet mikecollet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Slamik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on PHP 8.3 - everything works well!

@BackuPs BackuPs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in wp 8.3.4 Works just fine !

@windhamdavid

Copy link
Copy Markdown

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/

@interconnectitalfie interconnectitalfie merged commit 90ffbc2 into interconnectit:master Jan 31, 2025
@midweste

midweste commented Feb 2, 2025

Copy link
Copy Markdown

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
Stack trace:
#0 /app/web/wp-includes/class-wp-fatal-error-handler.php(156): WP_Fatal_Error_Handler->display_default_error_template(Array, false)
#1 /app/web/wp-includes/class-wp-fatal-error-handler.php(60): WP_Fatal_Error_Handler->display_error_template(Array, false)
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /app/web/wp-includes/class-wp-fatal-error-handler.php on line 245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

8 participants