osompress / simple-social-icons

Plugin: Simple Social Icons
62 stars 33 forks source link

Warning: sprintf(): Too few arguments in simple-social-icons.php on line 458 #106

Closed johnstonphilip closed 4 years ago

johnstonphilip commented 4 years ago

Describe the bug When I add the Social Icons widget to my sidebar with a link, it gives this warning:

Warning: sprintf(): Too few arguments in simple-social-icons.php on line 458

I believe this is due to the url being escaped, which causes it to have an extra % sign. That causes sprintf to think there should be more values passed in.

Changing the esc_url to esc_attr fixes the issue here: https://github.com/studiopress/simple-social-icons/blob/develop/simple-social-icons.php#L567

To Reproduce Steps to reproduce the behavior:

  1. Add the Social Icons widget to your sidebar.
  2. Add some social links.
  3. View the page.
  4. See the warning.

Expected behavior Icons are output with no warnings or errors.

Screenshots

Screen Shot 2020-04-02 at 4 40 19 PM

Version

nickcernis commented 4 years ago

(Dupe of https://github.com/studiopress/simple-social-icons/issues/107 — looks like GitHub double-posted during it's time-out yesterday.)