Compatible with PHP 8.0, 8.1?
-
Is the latest version of the plugin compatible with PHP 8.0, 8.1?
Plugin ver. 2.2.2 crash my site with PHP 8.1, fatal error.
___
Error in the file (line 602):
/autoptimize/classes/autoptimizeStyles.php
Text of error:
PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /public_html/wp-content/plugins/autoptimize/classes/autoptimizeStyles.php on line 602
Target code:
$url = $noQurl; if ( '/' === $url{0} || preg_match( '#^(https?://|ftp://|data:)#i', $url ) ) { // URL is protocol-relative, host-relative or something we don't touch continue; } else { // Relative URL $newurl = preg_replace( '/https?:/', '', str_replace( ' ', '%20', AUTOPTIMIZE_WP_ROOT_URL . str_replace( '//', '/', $dir . '/' . $url ) ) ); // Hash the url + whatever was behind potentially for replacement // We must do this, or different css classes referencing the same bg image (but // different parts of it, say, in sprites and such) loose their stuff... $hash = md5( $url . $matches[2][$k] ); $code = str_replace( $matches[0][$k], $hash, $code ); if ( $removedQuotes ) { $replace[$hash] = "url('" . $newurl . "')" . $matches[2][$k]; } else { $replace[$hash] = 'url(' . $newurl . ')' . $matches[2][$k]; } }
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘Compatible with PHP 8.0, 8.1?’ is closed to new replies.