From 9b8123711cc8968a56142521af4958a11b0082ff Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 15 Sep 2012 20:13:44 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@21862 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 272df00864..1ffe0451b8 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1787,13 +1787,13 @@ class WP_Query { // Tag stuff if ( '' != $q['tag'] && !$this->is_singular && $this->query_vars_changed ) { if ( strpos($q['tag'], ',') !== false ) { - $tags = preg_split('/[,\s]+/', $q['tag']); + $tags = preg_split('/[,\r\n\t ]+/', $q['tag']); foreach ( (array) $tags as $tag ) { $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); $q['tag_slug__in'][] = $tag; } - } else if ( preg_match('/[+\s]+/', $q['tag']) || !empty($q['cat']) ) { - $tags = preg_split('/[+\s]+/', $q['tag']); + } else if ( preg_match('/[+\r\n\t ]+/', $q['tag']) || !empty($q['cat']) ) { + $tags = preg_split('/[+\r\n\t ]+/', $q['tag']); foreach ( (array) $tags as $tag ) { $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); $q['tag_slug__and'][] = $tag;