From 9627196cb43a2e6b27e4fa96931c965ac01eb287 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 29 Apr 2009 16:25:33 +0000 Subject: [PATCH] Sanitize when querying against category name so that multiple-word subcategories match. props filosofo. fixes #8619 git-svn-id: https://develop.svn.wordpress.org/trunk@11121 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wp-includes/query.php b/wp-includes/query.php index f723f97bb3..469b37c88d 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1814,6 +1814,7 @@ class WP_Query { // Category stuff for nice URLs if ( '' != $q['category_name'] && !$this->is_singular ) { + $q['category_name'] = implode('/', array_map('sanitize_title', explode('/', $q['category_name']))); $reqcat = get_category_by_path($q['category_name']); $q['category_name'] = str_replace('%2F', '/', urlencode(urldecode($q['category_name']))); $cat_paths = '/' . trim($q['category_name'], '/');