printf() [function.printf] warning on search (2 posts)

  1. thiago censi
    Posted 6 years ago #

    I am getting this error when I search for a string containing the '%' (like in 100%) caracter in the comments page in the admin area:
    Warning: printf() [function.printf]: Too few arguments in (...)/wp-admin/edit-comments.php on line 104

    It doesn't seem to be a plugin problem (I think), but something related to the esc_html or the stripslashes function, that is not properly scaping the %.

    I tried other characters, but the only one that returns this warning is the %, probably because of its use in the sql query. The search returns the comments correctly, though.

    Is there something I can do to fix it?

  2. f00bar
    Posted 6 years ago #

    This is a SQL problem. It's because it uses the % sign in a different way. The only way to search for a literal "%" is to double it. I.e. search for %% instead and it will return any comment containing %.

    Hope this helps if you didn't already figure it out.

Topic Closed

This topic has been closed to new replies.

About this Topic