Ticket #7131: rewrite.diff
File rewrite.diff, 3.2 KB (added by , 12 years ago) |
---|
-
opt/lampp/htdocs/wordpress/wp-includes/rewrite.php
1338 1338 1339 1339 //create query for /page/xx 1340 1340 $pagematch = $match . $pageregex; 1341 $pagequery = $index . '?' . $query . '& paged=' . $this->preg_index($num_toks + 1);1341 $pagequery = $index . '?' . $query . '&paged=' . $this->preg_index($num_toks + 1); 1342 1342 1343 1343 //create query for /comment-page-xx 1344 1344 $commentmatch = $match . $commentregex; 1345 $commentquery = $index . '?' . $query . '& cpage=' . $this->preg_index($num_toks + 1);1345 $commentquery = $index . '?' . $query . '&cpage=' . $this->preg_index($num_toks + 1); 1346 1346 1347 1347 //create query for /feed/(feed|atom|rss|rss2|rdf) 1348 1348 $feedmatch = $match . $feedregex; 1349 $feedquery = $feedindex . '?' . $query . '& feed=' . $this->preg_index($num_toks + 1);1349 $feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1); 1350 1350 1351 1351 //create query for /(feed|atom|rss|rss2|rdf) (see comment near creation of $feedregex) 1352 1352 $feedmatch2 = $match . $feedregex2; 1353 $feedquery2 = $feedindex . '?' . $query . '& feed=' . $this->preg_index($num_toks + 1);1353 $feedquery2 = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1); 1354 1354 1355 1355 //if asked to, turn the feed queries into comment feed ones 1356 1356 if ($forcomments) { 1357 $feedquery .= '& withcomments=1';1358 $feedquery2 .= '& withcomments=1';1357 $feedquery .= '&withcomments=1'; 1358 $feedquery2 .= '&withcomments=1'; 1359 1359 } 1360 1360 1361 1361 //start creating the array of rewrites for this dir … … 1426 1426 1427 1427 //create queries for these extra tag-ons we've just dealt with 1428 1428 $subquery = $index . '?attachment=' . $this->preg_index(1); 1429 $subtbquery = $subquery . '& tb=1';1430 $subfeedquery = $subquery . '& feed=' . $this->preg_index(2);1431 $subcommentquery = $subquery . '& cpage=' . $this->preg_index(2);1429 $subtbquery = $subquery . '&tb=1'; 1430 $subfeedquery = $subquery . '&feed=' . $this->preg_index(2); 1431 $subcommentquery = $subquery . '&cpage=' . $this->preg_index(2); 1432 1432 1433 1433 //do endpoints for attachments 1434 1434 if ( !empty($endpoint) ) { foreach ( (array) $ep_query_append as $regex => $ep ) { … … 1444 1444 1445 1445 //allow URLs like <permalink>/2 for <permalink>/page/2 1446 1446 $match = $match . '(/[0-9]+)?/?$'; 1447 $query = $index . '?' . $query . '& page=' . $this->preg_index($num_toks + 1);1447 $query = $index . '?' . $query . '&page=' . $this->preg_index($num_toks + 1); 1448 1448 } else { //not matching a permalink so this is a lot simpler 1449 1449 //close the match and finalise the query 1450 1450 $match .= '?$'; … … 1526 1526 '.*wp-rss.php$' => $this->index .'?feed=rss', 1527 1527 '.*wp-rss2.php$' => $this->index .'?feed=rss2', 1528 1528 '.*wp-feed.php$' => $this->index .'?feed=feed', 1529 '.*wp-commentsrss2.php$' => $this->index . '?feed=rss2& withcomments=1');1529 '.*wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1'); 1530 1530 1531 1531 // Post 1532 1532 $post_rewrite = $this->generate_rewrite_rules($this->permalink_structure, EP_PERMALINK);