Hello @timwhitlock ,
Although it doesn’t have errors, PHPCS is still triggered by the has_magic_quotes function.
Could you update if to tell PHPCS to ignore the line as the PHP version check is done manually to avoid error?
private static function has_magic_quotes(){
// phpcs:ignore -- PHP version is checked prior to deprecated function call.
return version_compare(PHP_VERSION,'7.4','<') && ( get_magic_quotes_gpc() || get_magic_quotes_runtime() );
}
Same in the DebugController
line 158 and following.
if( version_compare(PHP_VERSION,'7.4','<') ){
// phpcs:disable -- PHP version is checked prior to deprecated function call.
if( get_magic_quotes_gpc() ){
Loco_error_AdminNotices::info('You have "magic_quotes_gpc" enabled. We recommend you disable this in PHP');
}
if( get_magic_quotes_runtime() ){
Loco_error_AdminNotices::info('You have "magic_quotes_runtime" enabled. We recommend you disable this in PHP');
}
if( version_compare(PHP_VERSION,'5.6.20','<') ){
Loco_error_AdminNotices::info('Your PHP version is very old. We recommend you upgrade');
}
// phpcs:enable
}