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
This commit is contained in:
ryan 2011-11-17 18:43:33 +00:00
parent 66388c185e
commit d3030023cf

View File

@ -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] ) {