Changeset 2791
- Timestamp:
- 01/11/2011 07:50:36 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/bb-includes/wp-functions.php
r2381 r2791 13 13 $original_url = $url; 14 14 15 if ('' == $url) return $url; 15 if ( '' == $url ) 16 return $url; 16 17 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url); 17 18 $strip = array('%0d', '%0a', '%0D', '%0A'); … … 28 29 // Replace ampersands and single quotes only when displaying. 29 30 if ( 'display' == $context ) { 30 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 31 $url = wp_kses_normalize_entities( $url ); 32 $url = str_replace( '&', '&', $url ); 31 33 $url = str_replace( "'", ''', $url ); 32 34 } 33 35 34 36 if ( !is_array($protocols) ) 35 $protocols = array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');37 $protocols = array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn'); 36 38 if ( wp_kses_bad_protocol( $url, $protocols ) != $url ) 37 39 return '';
Note: See TracChangeset
for help on using the changeset viewer.