• Resolved Servicemagic EU

    (@servicemagic-eu)


    Hello,

    Congratulations for your useful plugin.

    I just want to tell you that 75% of the results are tainted by this message:

    INFO: Non-printable characters were found in the xxx file. You may want to check this file for errors.

    I think that this INFO message should not be raised, as the file is in UTF-8 and all the characters are well encoded in UTF-8.

    https://www.ads-software.com/plugins/theme-check/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    PHP files should be saved without a BOM at the beginning of the file. Check to see if that is there.

    Thread Starter Servicemagic EU

    (@servicemagic-eu)

    They are saved without the BOM.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The BOM is the sole reason for the check, because having a BOM before the opening <?php marker can cause PHP to output it first, which can break things like cookies.

    If there is no BOM, then the message is an INFO, which means you can safely ignore it if everything else is correct in the file. INFO messages are informational in nature. They’re sanity checks, nothing more.

    Thread Starter Servicemagic EU

    (@servicemagic-eu)

    Yes they appear as INFO as I said in the first message.
    The problem is that they shouldn’t be displayed, even as INFO, as it is a normal behavior.
    They represent 75% of all the messages and they are tainted the other real messages.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    I have no current plans to alter this behavior. INFO messages can be ignored if they are incorrect.

    chrillep

    (@chrillep)

    the fix would be as stated in
    preg_match

    so from
    '[\x00-\x08\x0B-\x0C\x0E-\x1F\x80-\xFF]/'
    in nonprintable.php
    to
    '/(*UTF8)[\x00-\x08\x0B-\x0C\x0E-\x1F\x80-\xFF]/'

    chrillep

    (@chrillep)

    hmm revised it read at
    PHP: How to remove all non printable characters in a string?
    so used '/(*UTF8)[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\x9F]/'
    worked for swedish printable chars

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘"Non-printable characters" false positive’ is closed to new replies.