-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.3 Compatibility #194
Comments
@faisal-alvi @dkotter I wasn't able to reproduce this on latest trunk or even on 2.2.4 with the given instructions. I upgraded to PHP 8.3 and visited page with no SVG, page with SVG and even editor with with and without SVG. I wasn't able to see that warning in the logs. Can you folks confirm? |
@kirtangajjar I tested and did not encounter the PHP warning either. I reviewed the code on line 652 as mentioned, and it doesn't seem to be the source of the issue. It appears the code has either been updated or maybe an older version was used during testing. However, I think the following line of. code could be the source for the warning: Line 543 in ec4f598
@drazenbebic could you please share the plugin version used during testing? Alternatively, sharing the code around the line 652 of your |
@faisal-alvi I just checked, we're using the latest version (2.2.4). I even tried completely deleting the plugin and installing it again from the plugin store, but I still get the same warning. I must add: The warning is now coming from line 691, not 652 anymore. Like you said, it's the line you mentioned. Here's the code around line 691 ( public function disable_srcset( $image_meta, $size_array, $image_src, $attachment_id ) {
if ( $attachment_id && 'image/svg+xml' === get_post_mime_type( $attachment_id ) ) {
$image_meta['sizes'] = array();
}
return $image_meta;
} I was debugging the issue a little bit and found out that sometimes the This happens because Then this TLDR; This sounds more like a WordPress core bug than an issue with your plugin. I already found an alternative way for us to handle it. Not sure if you want to handle this on your side too? |
@drazenbebic thank you for the details. I've raised PR #203, please confirm if it removes the warning. |
Describe the bug
There is a small PHP warning coming from your plugin when upgrading to PHP 8.3:
Deprecated: Automatic conversion of false to array is deprecated in /wp-content/plugins/safe-svg/safe-svg.php on line 652
Steps to Reproduce
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: