Ticket #24225: 24225.2.diff
File 24225.2.diff, 3.0 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/media.php
150 150 // convert any remaining line breaks to <br> 151 151 $caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption ); 152 152 153 $html = preg_replace( '/(class= ["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );153 $html = preg_replace( '/(class=(["\'])[^\\2]*)align(none|left|right|center)\s?/', '$1', $html ); 154 154 if ( empty($align) ) 155 155 $align = 'none'; 156 156 -
wp-includes/media.php
1929 1929 $data = array(); 1930 1930 1931 1931 foreach ( $items as $item ) { 1932 preg_match_all( '#src= [\'"](.+?)[\'"]#is', $item, $src, PREG_SET_ORDER );1932 preg_match_all( '#src=([\'"])(.+?)\\1#is', $item, $src, PREG_SET_ORDER ); 1933 1933 if ( ! empty( $src ) ) { 1934 1934 $srcs = array(); 1935 1935 foreach ( $src as $s ) 1936 $srcs[] = $s[ 1];1936 $srcs[] = $s[2]; 1937 1937 1938 1938 $data[] = array_values( array_unique( $srcs ) ); 1939 1939 } … … 2254 2254 $srcs = array(); 2255 2255 2256 2256 foreach ( $tags as $tag ) { 2257 preg_match( '#src= [\'"](.+?)[\'"]#is', $tag, $src );2258 if ( ! empty( $src[ 1] ) ) {2259 $srcs[] = $src[ 1];2257 preg_match( '#src=([\'"])(.+?)\\1#is', $tag, $src ); 2258 if ( ! empty( $src[2] ) ) { 2259 $srcs[] = $src[2]; 2260 2260 if ( $limit > 0 && count( $srcs ) >= $limit ) 2261 2261 break; 2262 2262 } … … 2310 2310 if ( $html ) { 2311 2311 $galleries[] = $gallery; 2312 2312 } else { 2313 preg_match_all( '#src= [\'"](.+?)[\'"]#is', $gallery, $src, PREG_SET_ORDER );2313 preg_match_all( '#src=([\'"])(.+?)\\1#is', $gallery, $src, PREG_SET_ORDER ); 2314 2314 if ( ! empty( $src ) ) { 2315 2315 foreach ( $src as $s ) 2316 $srcs[] = $s[ 1];2316 $srcs[] = $s[2]; 2317 2317 } 2318 2318 2319 2319 $data['src'] = array_values( array_unique( $srcs ) ); -
wp-includes/post-formats.php
789 789 790 790 return $trimmed; 791 791 // the content is HTML so we grab the first href 792 } elseif ( preg_match( '/<a\s[^>]*?href= [\'"](.+?)[\'"]/is', $content, $matches ) ) {793 return esc_url_raw( $matches[ 1] );792 } elseif ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\\1/is', $content, $matches ) ) { 793 return esc_url_raw( $matches[2] ); 794 794 } 795 795 796 796 $lines = explode( "\n", $trimmed ); -
wp-includes/formatting.php
3201 3201 function _links_add_target( $m ) { 3202 3202 global $_links_add_target; 3203 3203 $tag = $m[1]; 3204 $link = preg_replace('|(target= [\'"](.*?)[\'"])|i', '', $m[2]);3204 $link = preg_replace('|(target=([\'"])(.*?)\\2)|i', '', $m[2]); 3205 3205 return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">'; 3206 3206 } 3207 3207