Changeset 11844
- Timestamp:
- 08/19/2009 11:56:10 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/formatting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r11813 r11844 1186 1186 function _make_url_clickable_cb($matches) { 1187 1187 $url = $matches[2]; 1188 1189 $after = ''; 1190 if ( preg_match( '|(.+)([).])$|', $url, $split ) ) { 1191 $url = $split[1]; 1192 $after = $split[2]; 1193 } 1194 1188 1195 $url = esc_url($url); 1189 1196 if ( empty($url) ) 1190 1197 return $matches[0]; 1191 return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>"; 1198 1199 return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>$after"; 1192 1200 } 1193 1201 … … 1211 1219 if ( empty($dest) ) 1212 1220 return $matches[0]; 1213 // removed trailing [,;:] from URL 1214 if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) { 1221 1222 // removed trailing [.,;:)] from URL 1223 if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) { 1215 1224 $ret = substr($dest, -1); 1216 1225 $dest = substr($dest, 0, strlen($dest)-1); 1217 1226 } 1218 return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a> " . $ret;1227 return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret"; 1219 1228 } 1220 1229
Note: See TracChangeset
for help on using the changeset viewer.