WordPress.org

Make WordPress Core

Changeset 21862


Ignore:
Timestamp:
09/15/12 20:13:44 (3 years ago)
Author:
nacin
Message:

Split tag names by [\r\n\t ] rather than \s to avoid that character class from eating characters. props rstern, SergeyBiryukov. fixes #21779. see #13413.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r21855 r21862  
    17881788        if ( '' != $q['tag'] && !$this->is_singular && $this->query_vars_changed ) { 
    17891789            if ( strpos($q['tag'], ',') !== false ) { 
    1790                 $tags = preg_split('/[,\s]+/', $q['tag']); 
     1790                $tags = preg_split('/[,\r\n\t ]+/', $q['tag']); 
    17911791                foreach ( (array) $tags as $tag ) { 
    17921792                    $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); 
    17931793                    $q['tag_slug__in'][] = $tag; 
    17941794                } 
    1795             } else if ( preg_match('/[+\s]+/', $q['tag']) || !empty($q['cat']) ) { 
    1796                 $tags = preg_split('/[+\s]+/', $q['tag']); 
     1795            } else if ( preg_match('/[+\r\n\t ]+/', $q['tag']) || !empty($q['cat']) ) { 
     1796                $tags = preg_split('/[+\r\n\t ]+/', $q['tag']); 
    17971797                foreach ( (array) $tags as $tag ) { 
    17981798                    $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); 
Note: See TracChangeset for help on using the changeset viewer.