• We were having problems with this plugin not displaying URLs in tweets on a particular website. After investigating, it turned out the problem was that the user prefixed all his URLs with a tilde “~” character (e.g. “Google is fun ~http://google.com”). The regex used in this plugin fails to match that (admittedly probably rare) condition. It’s an easy fix:

    I changed the regex fragment on line 789 of wp-twitter-widget.php from this:

    ([\\s(<.,;:!?])

    To this:

    ([\\s(<.,;:!?\~])

    And all is well now. I don’t think this should cause any other ill effects, so it would be nice if this fix could be incorporated in the next rev of the plugin code. Might not be a bad idea to add a dash (hyphen) to the list as well, I’ve seen that used occasionally too. Thanks!

    https://wordpress.org/plugins/twitter-widget-pro/

  • The topic ‘Regex fails to match URLs following a tilde character’ is closed to new replies.