Changeset 12088
- Timestamp:
- 10/22/2009 06:46:27 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/formatting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r12084 r12088 1233 1233 $url = $matches[2]; 1234 1234 1235 $after = '';1236 if ( preg_match( '|(.+?)([).,;:]*)$|', $url, $split ) ) {1237 $url = $split[1];1238 $after = $split[2];1239 }1240 1241 1235 $url = esc_url($url); 1242 1236 if ( empty($url) ) 1243 1237 return $matches[0]; 1244 1238 1245 return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a> $after";1239 return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>"; 1246 1240 } 1247 1241 … … 1305 1299 $ret = ' ' . $ret; 1306 1300 // in testing, using arrays here was found to be faster 1307 $ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/ \-=?@\[\](+]|[.,;:](?![\s<])|(?(1)\)(?![\s<])|\)))+)#is', '_make_url_clickable_cb', $ret);1301 $ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/=?@\[\](+-]|[.,;:](?![\s<]|(\))?([\s]|$))|(?(1)\)(?![\s<]|$)|\)))+)#is', '_make_url_clickable_cb', $ret); 1308 1302 $ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret); 1309 1303 $ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);
Note: See TracChangeset
for help on using the changeset viewer.