Use array_append() instead of unions. Props majelbstoat. fixes #2321

git-svn-id: http://svn.automattic.com/wordpress/trunk@3472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-01-23 23:20:17 +00:00
parent cdc37f33a4
commit f4071a3759
1 changed files with 9 additions and 11 deletions

View File

@ -971,13 +971,13 @@ class WP_Rewrite {
if( is_array( $attachment_uris ) ) {
foreach ($attachment_uris as $uri => $pagename) {
$this->add_rewrite_tag('%pagename%', "($uri)", 'attachment=');
$rewrite_rules += $this->generate_rewrite_rules($page_structure);
$rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure));
}
}
if( is_array( $uris ) ) {
foreach ($uris as $uri => $pagename) {
$this->add_rewrite_tag('%pagename%', "($uri)", 'pagename=');
$rewrite_rules += $this->generate_rewrite_rules($page_structure);
$rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure));
}
}
@ -1239,7 +1239,7 @@ class WP_Rewrite {
if ($feed)
$rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2);
if ($paged)
$rewrite = $rewrite + array($pagematch => $pagequery);
$rewrite = array_merge($rewrite, array($pagematch => $pagequery));
if ($num_toks) {
$post = false;
@ -1274,19 +1274,17 @@ class WP_Rewrite {
$query = $index . '?' . $query;
}
$rewrite = $rewrite + array($match => $query);
$rewrite = array_merge($rewrite, array($match => $query));
if ($post) {
$rewrite = array($trackbackmatch => $trackbackquery) + $rewrite;
$rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite);
if ( ! $page )
$rewrite = $rewrite + array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery);
$rewrite = $rewrite + array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery);
$rewrite = array_merge($rewrite, array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery));
$rewrite = array_merge($rewrite, array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery));
}
}
$post_rewrite = $rewrite + $post_rewrite;
$post_rewrite = array_merge($rewrite, $post_rewrite);
}
return $post_rewrite;
}
@ -1339,7 +1337,7 @@ class WP_Rewrite {
$page_rewrite = apply_filters('page_rewrite_rules', $page_rewrite);
// Put them together.
$this->rules = $page_rewrite + $root_rewrite + $comments_rewrite + $search_rewrite + $category_rewrite + $author_rewrite + $date_rewrite + $post_rewrite;
$this->rules = array_merge($page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite);
do_action('generate_rewrite_rules', array(&$this));
$this->rules = apply_filters('rewrite_rules_array', $this->rules);