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.

CommentFileSizeAuthor
#3 print-3180894-3.patch738 bytessolideogloria
#2 print-3180894.patch737 bytesbburg

Comments

bburg created an issue. See original summary.

bburg’s picture

Status: Active » Needs review
StatusFileSize
new737 bytes
solideogloria’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new738 bytes

This works. I added a period at the end of the comment.

renatog’s picture

Really makes sense

  • RenatoG committed e20bf4c on 7.x-2.x authored by bburg
    Issue #3180894 by bburg, solideogloria, RenatoG: PHP 7 Compatibility...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the dev branch

Thank you so much, everyone

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.