Support » Fixing WordPress » printf() [function.printf] warning on search

  • 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?

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘printf() [function.printf] warning on search’ is closed to new replies.