From d3030023cfd17a3de0f27b7712b0b9611fa22864 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 17 Nov 2011 18:43:33 +0000 Subject: [PATCH] Avoid notice when handling malformed permalink structure. Props SergeyBiryukov. fixes #18883 git-svn-id: http://svn.automattic.com/wordpress/trunk@19322 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rewrite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index c12f1301a..d376df40d 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1264,7 +1264,7 @@ class WP_Rewrite { $num_toks = preg_match_all('/%.+?%/', $struct, $toks); //get the 'tagname=$matches[i]' - $query = ( isset($queries) && is_array($queries) ) ? $queries[$num_toks - 1] : ''; + $query = ( isset($queries) && is_array($queries) && !empty($num_toks) ) ? $queries[$num_toks - 1] : ''; //set up $ep_mask_specific which is used to match more specific URL types switch ( $dirs[$j] ) {