Make WordPress Core


Ignore:
Timestamp:
01/23/2006 11:20:17 PM (19 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r3467 r3472  
    972972            foreach ($attachment_uris as $uri => $pagename) {
    973973                $this->add_rewrite_tag('%pagename%', "($uri)", 'attachment=');
    974                 $rewrite_rules += $this->generate_rewrite_rules($page_structure);
     974                $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure));
    975975            }
    976976        }
     
    978978            foreach ($uris as $uri => $pagename) {
    979979                $this->add_rewrite_tag('%pagename%', "($uri)", 'pagename=');
    980                 $rewrite_rules += $this->generate_rewrite_rules($page_structure);
     980                $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure));
    981981            }
    982982        }
     
    12401240                $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2);
    12411241            if ($paged)
    1242                 $rewrite = $rewrite + array($pagematch => $pagequery);
     1242                $rewrite = array_merge($rewrite, array($pagematch => $pagequery));
    12431243
    12441244            if ($num_toks) {
     
    12751275                }
    12761276                       
    1277                 $rewrite = $rewrite + array($match => $query);
     1277                $rewrite = array_merge($rewrite, array($match => $query));
    12781278
    12791279                if ($post) {
    1280                     $rewrite = array($trackbackmatch => $trackbackquery) + $rewrite;
     1280                    $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite);
    12811281                    if ( ! $page )
    1282                         $rewrite = $rewrite + array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery);
    1283                     $rewrite = $rewrite + array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery);
    1284                 }
    1285             }
    1286 
    1287             $post_rewrite = $rewrite + $post_rewrite;
    1288         }
    1289 
     1282                        $rewrite = array_merge($rewrite, array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery));
     1283                    $rewrite = array_merge($rewrite, array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery));
     1284                }
     1285            }
     1286            $post_rewrite = array_merge($rewrite, $post_rewrite);
     1287        }
    12901288        return $post_rewrite;
    12911289    }
     
    13401338
    13411339        // Put them together.
    1342         $this->rules = $page_rewrite + $root_rewrite + $comments_rewrite + $search_rewrite + $category_rewrite + $author_rewrite + $date_rewrite + $post_rewrite;
     1340        $this->rules = array_merge($page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite);
    13431341
    13441342        do_action('generate_rewrite_rules', array(&$this));
Note: See TracChangeset for help on using the changeset viewer.