You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find a report of this issue so I'm submitting it.
The below error occurs when running Multisite Language Switcher in PHP version 8.1. This StackOverflow answer states FILTER_SANITIZE_STRING is deprecated in php 8.1 and there are multiple suggestions on how to update it.
...in MslsPlugin.php which appears to work fine but I don't understand exactly what it does.
To Reproduce
Steps to reproduce the behavior:
Go to Settings > General > Multisite Language Switcher.
Click on 'Save Changes' (you do not need to make a change).
See the following error:
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php on line 77 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-admin/includes/misc.php on line 1431 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-includes/functions.php on line 6896 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-includes/pluggable.php on line 1427 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-includes/pluggable.php on line 1430
Expected behaviour
There should be no error in PHP versions 8.1 or above.
Environment:
OS: WSL2 Ubuntu running Docker
Browser: Chrome in Windows
PHP Version 8.1
Plugin Version 2.5.8
The text was updated successfully, but these errors were encountered:
Not sure if its relevant but I found three instances of FILTER_SANITIZE_STRING in the repo. There is one in MslsMetaBox.php and one in WithRequestPostAttributes.php. I've changed them all to FILTER_SANITIZE_FULL_SPECIAL_CHARS and there don't appear to be any issues but I was never able to figure out how to build the repo locally and submit a pull request so I just made the changes directly in the built plugin.
Describe the bug
I can't find a report of this issue so I'm submitting it.
The below error occurs when running Multisite Language Switcher in PHP version 8.1. This StackOverflow answer states
FILTER_SANITIZE_STRING
is deprecated in php 8.1 and there are multiple suggestions on how to update it.I have changed...
$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );
to$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
...in
MslsPlugin.php
which appears to work fine but I don't understand exactly what it does.To Reproduce
Steps to reproduce the behavior:
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php on line 77 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-admin/includes/misc.php on line 1431 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-includes/functions.php on line 6896 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-includes/pluggable.php on line 1427 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/multisite-language-switcher/includes/MslsPlugin.php:77) in /var/www/html/wp-includes/pluggable.php on line 1430
Expected behaviour
There should be no error in PHP versions 8.1 or above.
Environment:
The text was updated successfully, but these errors were encountered: