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
This commit is contained in:
Ryan Boren 2011-11-17 18:43:33 +00:00
parent f626327800
commit 4bf96f393e
1 changed files with 1 additions and 1 deletions

View File

@ -1264,7 +1264,7 @@ class WP_Rewrite {
$num_toks = preg_match_all('/%.+?%/', $struct, $toks); $num_toks = preg_match_all('/%.+?%/', $struct, $toks);
//get the 'tagname=$matches[i]' //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 //set up $ep_mask_specific which is used to match more specific URL types
switch ( $dirs[$j] ) { switch ( $dirs[$j] ) {