Ticket #5607: remove_admin_notices3.diff
File remove_admin_notices3.diff, 2.2 KB (added by , 17 years ago) |
---|
-
wp-includes/rewrite.php
68 68 69 69 // First, check to see if there is a 'p=N' or 'page_id=N' to match against 70 70 preg_match('#[?&](p|page_id)=(\d+)#', $url, $values); 71 $id = intval($values[2]);71 $id = ( isset($values[2]) ) ? intval($values[2]) : 0; 72 72 if ( $id ) return $id; 73 73 74 74 // Check to see if we are using rewrite rules … … 591 591 for ($i = 0; $i < $num_tokens; ++$i) { 592 592 if (0 < $i) { 593 593 $queries[$i] = $queries[$i - 1] . '&'; 594 } else { 595 $queries[$i] = ''; 594 596 } 595 597 596 598 $query_token = str_replace($this->rewritecode, $this->queryreplace, $tokens[0][$i]) . $this->preg_index($i+1); … … 628 630 //make a list of tags, and store how many there are in $num_toks 629 631 $num_toks = preg_match_all('/%.+?%/', $struct, $toks); 630 632 //get the 'tagname=$matches[i]' 631 $query = $queries[$num_toks - 1];633 $query = ( isset($queries) && is_array($queries) ) ? $queries[$num_toks - 1] : ''; 632 634 633 635 //set up $ep_mask_specific which is used to match more specific URL types 634 636 switch ($dirs[$j]) { … … 721 723 $subfeedquery = $subquery . '&feed=' . $this->preg_index(2); 722 724 723 725 //do endpoints for attachments 724 if ( $endpoint) { foreach ($ep_query_append as $regex => $ep) {726 if (! empty($endpoint) ) { foreach ($ep_query_append as $regex => $ep) { 725 727 if ($ep[0] & EP_ATTACHMENT) { 726 728 $rewrite[$sub1 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); 727 729 $rewrite[$sub2 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); -
wp-includes/post.php
157 157 */ 158 158 function &get_post(&$post, $output = OBJECT, $filter = 'raw') { 159 159 global $wpdb; 160 $null = null; 160 161 161 162 if ( empty($post) ) { 162 163 if ( isset($GLOBALS['post']) ) 163 164 $_post = & $GLOBALS['post']; 164 165 else 165 return null;166 return $null; 166 167 } elseif ( is_object($post) ) { 167 168 wp_cache_add($post->ID, $post, 'posts'); 168 169 $_post = &$post; … … 2636 2637 } 2637 2638 } 2638 2639