Changes from branches/2.8/wp-includes/formatting.php at r11635 to trunk/wp-includes/formatting.php at r11518
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r11635 r11518 81 81 82 82 function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') { 83 $o = preg_quote($opening , '/');84 $c = preg_quote($closing , '/');83 $o = preg_quote($opening); 84 $c = preg_quote($closing); 85 85 foreach($disabled_elements as $element) { 86 86 if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element); … … 2043 2043 if ('' == $url) return $url; 2044 2044 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url); 2045 $strip = array('%0d', '%0a' , '%0D', '%0A');2046 $url = _deep_replace($strip, $url);2045 $strip = array('%0d', '%0a'); 2046 $url = str_replace($strip, '', $url); 2047 2047 $url = str_replace(';//', '://', $url); 2048 2048 /* If the URL doesn't appear to contain a scheme, we … … 2066 2066 2067 2067 return apply_filters('clean_url', $url, $original_url, $context); 2068 }2069 2070 /**2071 * Perform a deep string replace operation to ensure the values in $search are no longer present2072 *2073 * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values2074 * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that2075 * str_replace would return2076 *2077 * @since 2.8.12078 * @access private2079 *2080 * @param string|array $search2081 * @param string $subject2082 * @return string The processed string2083 */2084 function _deep_replace($search, $subject){2085 $found = true;2086 while($found) {2087 $found = false;2088 foreach( (array) $search as $val ) {2089 while(strpos($subject, $val) !== false) {2090 $found = true;2091 $subject = str_replace($val, '', $subject);2092 }2093 }2094 }2095 2096 return $subject;2097 2068 } 2098 2069
Note: See TracChangeset
for help on using the changeset viewer.