underscores are allowed in URLs

This commit is contained in:
2016-10-14 14:01:43 +02:00
parent 65e983bca1
commit 5076222243

View File

@@ -424,7 +424,7 @@ class better_twitter_widget extends WP_Widget {
$search = array(); $search = array();
$search[0] = '/([\s>\-\.])#([[:alnum:]öäü]+)/i'; // text #hash text; >#hash text $search[0] = '/([\s>\-\.])#([[:alnum:]öäü]+)/i'; // text #hash text; >#hash text
$search[1] = '/([\s>\-\.])@([[:alnum:]_]+)/'; // @user $search[1] = '/([\s>\-\.])@([[:alnum:]_]+)/'; // @user
$search[2] = '/([\s>\-\.])(https?:[\/[:alnum:]\.\?\&#\=\%\+\-]+)/'; // http... $search[2] = '/([\s>\-\.])(https?:[\/[:alnum:]\.\?\&#\=\%\+\-\_]+)/'; // http...
$replace = array(); $replace = array();
$replace[0] = '$1<a target="_blank" href="http://twitter.com/search?q=%23$2">#$2</a>'; $replace[0] = '$1<a target="_blank" href="http://twitter.com/search?q=%23$2">#$2</a>';