Make WordPress Core

Ticket #24225: 24225.3.diff

File 24225.3.diff, 2.4 KB (added by kovshenin, 12 years ago)
  • wp-includes/formatting.php

     
    32063206function _links_add_target( $m ) {
    32073207        global $_links_add_target;
    32083208        $tag = $m[1];
    3209         $link = preg_replace('|(target=[\'"](.*?)[\'"])|i', '', $m[2]);
     3209        $link = preg_replace('|(target=([\'"])(.*?)\2)|i', '', $m[2]);
    32103210        return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
    32113211}
    32123212
  • wp-includes/post-formats.php

     
    791791
    792792                return $trimmed;
    793793        // the content is HTML so we grab the first href
    794         } elseif ( preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', $content, $matches ) ) {
    795                 return esc_url_raw( $matches[1] );
     794        } elseif ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) {
     795                return esc_url_raw( $matches[2] );
    796796        }
    797797
    798798        $lines = explode( "\n", $trimmed );
  • wp-includes/media.php

     
    19291929        $data = array();
    19301930
    19311931        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 );
    19331933                if ( ! empty( $src ) ) {
    19341934                        $srcs = array();
    19351935                        foreach ( $src as $s )
    1936                                 $srcs[] = $s[1];
     1936                                $srcs[] = $s[2];
    19371937
    19381938                        $data[] = array_values( array_unique( $srcs ) );
    19391939                }
     
    22542254        $srcs = array();
    22552255
    22562256        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];
    22602260                        if ( $limit > 0 && count( $srcs ) >= $limit )
    22612261                                break;
    22622262                }
     
    23102310                                if ( $html ) {
    23112311                                        $galleries[] = $gallery;
    23122312                                } else {
    2313                                         preg_match_all( '#src=[\'"](.+?)[\'"]#is', $gallery, $src, PREG_SET_ORDER );
     2313                                        preg_match_all( '#src=([\'"])(.+?)\1#is', $gallery, $src, PREG_SET_ORDER );
    23142314                                        if ( ! empty( $src ) ) {
    23152315                                                foreach ( $src as $s )
    2316                                                         $srcs[] = $s[1];
     2316                                                        $srcs[] = $s[2];
    23172317                                        }
    23182318
    23192319                                        $data['src'] = array_values( array_unique( $srcs ) );