From 4bf96f393eb4807b41375d48aef35e6caa52cfc7 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@19322 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 c12f1301a1..d376df40d1 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] ) {