Running phpcs with the PHPCompatibility rule yields this error:
FILE: sites/all/modules/contrib/print/print_pdf/lib_handlers/print_pdf_dompdf/print_pdf_dompdf.pages.inc
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
137 | ERROR | Function recode_string() is removed since PHP 7.4; Use the iconv or mbstring extension instead
137 | ERROR | Extension 'recode' is removed since PHP 7.4; Use iconv or mbstring instead
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
The code in question:
elseif (function_exists('recode_string')) {
$html = recode_string('UTF-8..ISO_8859-1', $html);
}
I see this checks for the existence of the function first. I might suggest adding "// phpcs:ignore" above this line. Which will tell the scanner not to report the error and avoid people getting false positives in their own scans.
Comments
Comment #2
bburgComment #3
solideogloria commentedThis works. I added a period at the end of the comment.
Comment #4
renatog commentedReally makes sense
Comment #6
renatog commentedCommitted to the dev branch
Thank you so much, everyone