WordPress.org

Make WordPress Core

Ticket #24222: 24222.diff

File 24222.diff, 5.0 KB (added by kovshenin, 12 months ago)
  • wp-includes/ms-functions.php

     
    460460                $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character “_”!' ) ); 
    461461 
    462462        // all numeric? 
    463         $match = array(); 
    464463        preg_match( '/[0-9]*/', $user_name, $match ); 
    465464        if ( $match[0] == $user_name ) 
    466465                $errors->add('user_name', __('Sorry, usernames must have letters too!')); 
     
    572571                $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) ); 
    573572 
    574573        // all numeric? 
    575         $match = array(); 
    576574        preg_match( '/[0-9]*/', $blogname, $match ); 
    577575        if ( $match[0] == $blogname ) 
    578576                $errors->add('blogname', __('Sorry, site names must have letters too!')); 
  • wp-includes/shortcodes.php

     
    152152 */ 
    153153function has_shortcode( $content, $tag ) { 
    154154        if ( shortcode_exists( $tag ) ) { 
    155                 $matches = array(); 
    156155                preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); 
    157156                if ( empty( $matches ) ) 
    158157                        return false; 
  • wp-includes/post-template.php

     
    185185 
    186186        $output = ''; 
    187187        $has_teaser = false; 
    188         $matches = array(); 
    189188 
    190189        // If post password required and it doesn't match the cookie. 
    191190        if ( post_password_required() ) 
  • wp-includes/media.php

     
    19081908 */ 
    19091909function get_content_media( $type, &$content, $html = true, $remove = false, $limit = 0 ) { 
    19101910        $items = array(); 
    1911         $matches = array(); 
    19121911 
    19131912        if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { 
    19141913                foreach ( $matches as $shortcode ) { 
     
    19271926        if ( $html ) 
    19281927                return $items; 
    19291928 
    1930         $src = ''; 
    19311929        $data = array(); 
    19321930 
    19331931        foreach ( $items as $item ) { 
     
    19581956 */ 
    19591957function get_embedded_media( $type, &$content, $remove = false, $limit = 0 ) { 
    19601958        $html = array(); 
    1961         $matches = ''; 
    19621959 
    19631960        foreach ( array( $type, 'object', 'embed', 'iframe' ) as $tag ) { 
    19641961                if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) { 
     
    22062203 * @return array The found images or srcs 
    22072204 */ 
    22082205function get_content_images( &$content, $html = true, $remove = false, $limit = 0 ) { 
    2209         $matches = array(); 
    22102206        $tags = array(); 
    22112207        $captions = array(); 
    22122208 
     
    22552251        if ( $html ) 
    22562252                return $tags; 
    22572253 
    2258         $src = ''; 
    22592254        $srcs = array(); 
    22602255 
    22612256        foreach ( $tags as $tag ) { 
     
    23002295 * @return array A list of galleries, which in turn are a list of their srcs in order 
    23012296 */ 
    23022297function get_content_galleries( &$content, $html = true, $remove = false, $limit = 0 ) { 
    2303         $src = ''; 
    23042298        $galleries = array(); 
    2305         $matches = array(); 
    23062299 
    23072300        if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { 
    23082301                foreach ( $matches as $shortcode ) { 
     
    24932486                $urls[] = get_attachment_link( $media->ID ); 
    24942487 
    24952488                $count = 1; 
    2496                 $matches = array(); 
    24972489                $content = $post->post_content; 
    24982490 
    24992491                if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { 
  • wp-includes/post-formats.php

     
    580580                                continue; 
    581581                } 
    582582 
    583                 $matches = array(); 
    584583                $matched = preg_match( $newline_regex, $line, $matches ); 
    585584                if ( ! $matched ) 
    586585                        continue; 
     
    709708        if ( empty( $content ) ) 
    710709                return ''; 
    711710 
    712         $matches = array(); 
    713711        if ( ! preg_match( '/<blockquote[^>]*>(.+?)<\/blockquote>/is', $content, $matches ) ) { 
    714712                $quote = $content; 
    715713                if ( $remove || ! empty( $replace ) ) 
     
    783781        if ( empty( $content ) ) 
    784782                return ''; 
    785783 
    786         $matches = array(); 
    787  
    788784        // the content is a URL 
    789785        $trimmed = trim( $content ); 
    790786        if ( 0 === stripos( $trimmed, 'http' ) && ! preg_match( '#\s#', $trimmed ) ) { 
     
    883879 
    884880        $output = ''; 
    885881        $has_teaser = false; 
    886         $matches = array(); 
    887882 
    888883        // If post password required and it doesn't match the cookie. 
    889884        if ( post_password_required() ) 
  • wp-includes/formatting.php

     
    32643264                $filtered = trim( preg_replace('/[\r\n\t ]+/', ' ', $filtered) ); 
    32653265        } 
    32663266 
    3267         $match = array(); 
    32683267        $found = false; 
    32693268        while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) { 
    32703269                $filtered = str_replace($match[0], '', $filtered);