summaryrefslogtreecommitdiffstats
path: root/wp-includes/query.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/query.php')
-rw-r--r--wp-includes/query.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/wp-includes/query.php b/wp-includes/query.php
index 8114bd5..05f424d 100644
--- a/wp-includes/query.php
+++ b/wp-includes/query.php
@@ -819,8 +819,9 @@ class WP_Query {
$cat_paths = '/' . trim(urldecode($q['category_name']), '/');
$q['category_name'] = sanitize_title(basename($cat_paths));
$cat_paths = explode('/', $cat_paths);
- foreach($cat_paths as $pathdir)
- $cat_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
+ $cat_path = '';
+ foreach ( (array) $cat_paths as $pathdir )
+ $cat_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir);
//if we don't match the entire hierarchy fallback on just matching the nicename
if ( empty($reqcat) )