Sanitize when querying against category name so that multiple-word subcategories match. props filosofo. fixes #8619

git-svn-id: http://svn.automattic.com/wordpress/trunk@11121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-29 16:25:33 +00:00
parent 7587955a22
commit a240e226fb

View File

@ -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'], '/');