Skip to content

fix(connector): remove get_magic_quotes_gpc() for PHP 8 static analysis - #3806

Open
wpexpertsio wants to merge 1 commit into
Studio-42:masterfrom
wpexpertsio:fix/php8-remove-get-magic-quotes-gpc
Open

wpexpertsio wants to merge 1 commit into
Studio-42:masterfrom
wpexpertsio:fix/php8-remove-get-magic-quotes-gpc

Conversation

@wpexpertsio

Copy link
Copy Markdown
Contributor

Summary

Static PHP compatibility tools (e.g. PHPCompatibility, Plugin Check) flag get_magic_quotes_gpc() in elFinderConnector::input_filter() because the function was removed in PHP 8.0.

On PHP 8+, the existing guard (version_compare(PHP_VERSION, '5.4', '<')) prevents the function from being called at runtime (short-circuit), so behavior is already correct on supported PHP versions. The reference in source code still triggers scanner warnings for projects that bundle elFinder.

Change

In php/elFinderConnector.class.php, initialize $magic_quotes_gpc to false instead of calling get_magic_quotes_gpc().

Magic quotes were disabled/removed in PHP 5.4+, so stripslashes behavior is unchanged on modern PHP.

Testing

  • No functional change expected on PHP 5.4+ / PHP 8.x for connector input filtering.
  • Removes get_magic_quotes_gpc from the codebase for static analysis.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants