Changeset 6182 for trunk/wp-includes/formatting.php
- Timestamp:
- 10/03/2007 04:16:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r6150 r6182 1088 1088 } 1089 1089 1090 function clean_url( $url, $protocols = null ) {1090 function clean_url( $url, $protocols = null, $context = 'display' ) { 1091 1091 $original_url = $url; 1092 1092 … … 1104 1104 $url = 'http://' . $url; 1105 1105 1106 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1106 // Replace ampersands ony when displaying. 1107 if ( 'display' == $context ) 1108 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1109 1107 1110 if ( !is_array($protocols) ) 1108 1111 $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); … … 1110 1113 return ''; 1111 1114 1112 return apply_filters('clean_url', $url, $original_url); 1115 return apply_filters('clean_url', $url, $original_url, $context); 1116 } 1117 1118 function sanitize_url( $url, $protocols = null ) { 1119 return clean_url( $url, $protocols, 'db'); 1113 1120 } 1114 1121
Note: See TracChangeset
for help on using the changeset viewer.