Conversation
supportHi, We’re seeing a lot of these in the debug.log … [08-Feb-2023 11:15:20 UTC] E_NOTICE: String offset cast occurred in /wp-content/plugins/merge-minify-refresh/merge-minify-refresh.php on line 1064 Could you please investigate? Thank you, Oliver The page I need help with: [ log in to see the link]
Hi Oliver, I’m not getting these errors with PHP 7.4 or 8.1 What version of PHP are you using?
Hi, It’s PHP v7.4.32 If you cast the string offset to an integer on line 1064 … return sprintf('%.' . $decimals . 'f', $bytes / pow(1024, $factor)) . @$sz[(int)$factor]; … the PHP doesn’t generate a warning. The reason is that floor() returns an integer as a float and you require an integer to use as the string offset. Oliver
Thanks Oliver. I’ve pushed out an update to resolve this.
That’s great, thanks!
Hi Oliver, I’m not getting these errors with PHP 7.4 or 8.1 What version of PHP are you using?
Hi, It’s PHP v7.4.32 If you cast the string offset to an integer on line 1064 … return sprintf('%.' . $decimals . 'f', $bytes / pow(1024, $factor)) . @$sz[(int)$factor]; … the PHP doesn’t generate a warning. The reason is that floor() returns an integer as a float and you require an integer to use as the string offset. Oliver
Thanks Oliver. I’ve pushed out an update to resolve this.
That’s great, thanks!