[ERROR] WP Debug > PHP Deprecated: Array and string offset access syntax …
-
ERRORS & SOLUTION
Error severity: Very Low
PHP version affected: From PHP v7.4.x
Cause of the error: PHP deprecated syntax
Reference: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
System specifications: WordPress v5.6 with PHP v7.4.13
Affected plugin: Heroic Favicon Generator
Affected file: phpthumb.functions.php
Path of file: …/wp-content/plugins/favhero-favicon-generator/phpthumb/phpthumb.functions.php
Affected lines of codes: 212, 989
ERRORS:
PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /my-website.com/httpdocs/wp-content/plugins/favhero-favicon-generator/phpthumb/phpthumb.functions.php on line 212
PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /my-website.com/httpdocs/wp-content/plugins/favhero-favicon-generator/phpthumb/phpthumb.functions.php on line 989
SOLUTIONS:
LINE 212
Change this value:
$output .= ‘ 0x’.str_pad(dechex(ord($string{$i})), 2, ‘0’, STR_PAD_LEFT);
With this value:
$output .= ‘ 0x’.str_pad(dechex(ord($string[$i])), 2, ‘0’, STR_PAD_LEFT);LINE 989
Change this value:
$strtr_preg_quote[$escapeables{$i}] = $delimiter.$escapeables{$i};
With this value:
$strtr_preg_quote[$escapeables[$i]] = $delimiter.$escapeables{$i};I have tested this solution several times and it appears to be correct.
Hoping to have been useful, however, I await confirmation from you.
Good day and good work.
- The topic ‘[ERROR] WP Debug > PHP Deprecated: Array and string offset access syntax …’ is closed to new replies.