Changeset 2117 for trunk/wp-includes/functions-formatting.php
- Timestamp:
- 01/21/2005 06:24:14 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions-formatting.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-formatting.php
r2057 r2117 480 480 function make_clickable($ret) { 481 481 $ret = ' ' . $ret . ' '; 482 $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3' >$2://$3</a>", $ret);483 $ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4' >www.$2.$3$4</a>", $ret);482 $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3' rel='nofollow'>$2://$3</a>", $ret); 483 $ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4' rel='nofollow'>www.$2.$3$4</a>", $ret); 484 484 $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret); 485 485 $ret = trim($ret); 486 486 return $ret; 487 } 488 489 function wp_rel_nofollow( $text ) { 490 $text = preg_replace('|<a(.+?)>|i', '<a$1 rel="nofollow">', $text); 491 return $text; 487 492 } 488 493
Note: See TracChangeset
for help on using the changeset viewer.