Changeset 13689
- Timestamp:
- 03/13/2010 07:29:10 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/rewrite.php (modified) (50 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rewrite.php
r13688 r13689 35 35 function add_rewrite_tag($tagname, $regex) { 36 36 //validation 37 if ( strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%') {37 if ( strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%' ) 38 38 return; 39 }40 39 41 40 $qv = trim($tagname, '%'); … … 72 71 function add_feed($feedname, $function) { 73 72 global $wp_rewrite; 74 if ( !in_array($feedname, $wp_rewrite->feeds)) {//override the file if it is73 if ( ! in_array($feedname, $wp_rewrite->feeds) ) //override the file if it is 75 74 $wp_rewrite->feeds[] = $feedname; 76 }77 75 $hook = 'do_feed_' . $feedname; 78 76 // Remove default function hook … … 96 94 } 97 95 96 //pseudo-places 97 /** 98 * Endpoint Mask for default, which is nothing. 99 * 100 * @since 2.1.0 101 */ 102 define('EP_NONE', 0); 103 98 104 /** 99 105 * Endpoint Mask for Permalink. … … 186 192 */ 187 193 define('EP_PAGES', 4096); 188 189 //pseudo-places190 /**191 * Endpoint Mask for default, which is nothing.192 *193 * @since 2.1.0194 */195 define('EP_NONE', 0);196 194 197 195 /** … … 260 258 if ( preg_match('#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values) ) { 261 259 $id = absint($values[2]); 262 if ( $id)260 if ( $id ) 263 261 return $id; 264 262 } … … 315 313 // Look for matches. 316 314 $request_match = $request; 317 foreach ( $rewrite as $match => $query) {315 foreach ( (array)$rewrite as $match => $query) { 318 316 // If the requesting file is the anchor of the match, prepend it 319 317 // to the path info. 320 if ( (! empty($url)) && (strpos($match, $url) === 0) && ($url != $request)) {318 if ( !empty($url) && ($url != $request) && (strpos($match, $url) === 0) ) 321 319 $request_match = $url . '/' . $request; 322 }323 320 324 321 if ( preg_match("!^$match!", $request_match, $matches) ) { … … 329 326 // Substitute the substring matches into the query. 330 327 $query = addslashes(WP_MatchesMapRegex::apply($query, $matches)); 328 331 329 // Filter out non-public query vars 332 330 global $wp; … … 337 335 $query[$key] = $value; 338 336 } 337 339 338 // Do the query 340 339 $query = new WP_Query($query); … … 725 724 */ 726 725 function using_permalinks() { 727 if (empty($this->permalink_structure)) 726 return ! empty($this->permalink_structure); 727 } 728 729 /** 730 * Whether permalinks are being used and rewrite module is not enabled. 731 * 732 * Means that permalink links are enabled and index.php is in the URL. 733 * 734 * @since 1.5.0 735 * @access public 736 * 737 * @return bool 738 */ 739 function using_index_permalinks() { 740 if ( empty($this->permalink_structure) ) 728 741 return false; 729 else 742 743 // If the index is not in the permalink, we're using mod_rewrite. 744 if ( preg_match('#^/*' . $this->index . '#', $this->permalink_structure) ) 730 745 return true; 731 } 732 733 /** 734 * Whether permalinks are being used and rewrite module is not enabled. 735 * 736 * Means that permalink links are enabled and index.php is in the URL. 746 747 return false; 748 } 749 750 /** 751 * Whether permalinks are being used and rewrite module is enabled. 752 * 753 * Using permalinks and index.php is not in the URL. 737 754 * 738 755 * @since 1.5.0 … … 741 758 * @return bool 742 759 */ 743 function using_index_permalinks() {744 if (empty($this->permalink_structure)) {745 return false;746 }747 748 // If the index is not in the permalink, we're using mod_rewrite.749 if (preg_match('#^/*' . $this->index . '#', $this->permalink_structure)) {750 return true;751 }752 753 return false;754 }755 756 /**757 * Whether permalinks are being used and rewrite module is enabled.758 *759 * Using permalinks and index.php is not in the URL.760 *761 * @since 1.5.0762 * @access public763 *764 * @return bool765 */766 760 function using_mod_rewrite_permalinks() { 767 if ( $this->using_permalinks() && ! $this->using_index_permalinks() )761 if ( $this->using_permalinks() && ! $this->using_index_permalinks() ) 768 762 return true; 769 763 else … … 826 820 $page_attachment_uris = array(); 827 821 828 foreach ( $posts as $id => $post) {822 foreach ( $posts as $id => $post ) { 829 823 // URL => page name 830 824 $uri = get_page_uri($id); 831 825 $attachments = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $id )); 832 if ( $attachments) {826 if ( !empty($attachments) ) { 833 827 foreach ( $attachments as $attachment ) { 834 828 $attach_uri = get_page_uri($attachment->ID); … … 870 864 $attachment_uris = $page_uris[1]; 871 865 872 if ( is_array( $attachment_uris ) ) {873 foreach ( $attachment_uris as $uri => $pagename) {866 if ( is_array( $attachment_uris ) ) { 867 foreach ( $attachment_uris as $uri => $pagename ) { 874 868 $this->add_rewrite_tag('%pagename%', "($uri)", 'attachment='); 875 869 $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); 876 870 } 877 871 } 878 if ( is_array( $uris ) ) {879 foreach ( $uris as $uri => $pagename) {872 if ( is_array( $uris ) ) { 873 foreach ( $uris as $uri => $pagename ) { 880 874 $this->add_rewrite_tag('%pagename%', "($uri)", 'pagename='); 881 875 $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); … … 907 901 */ 908 902 function get_date_permastruct() { 909 if ( isset($this->date_structure)) {903 if ( isset($this->date_structure) ) 910 904 return $this->date_structure; 911 } 912 913 if (empty($this->permalink_structure)) { 905 906 if ( empty($this->permalink_structure) ) { 914 907 $this->date_structure = ''; 915 908 return false; … … 922 915 $date_endian = ''; 923 916 924 foreach ( $endians as $endian) {925 if ( false !== strpos($this->permalink_structure, $endian)) {917 foreach ( $endians as $endian ) { 918 if ( false !== strpos($this->permalink_structure, $endian) ) { 926 919 $date_endian= $endian; 927 920 break; … … 938 931 $tok_index = 1; 939 932 foreach ( (array) $tokens[0] as $token) { 940 if ( ($token == '%post_id%')&& ($tok_index <= 3) ) {933 if ( '%post_id%' == $token && ($tok_index <= 3) ) { 941 934 $front = $front . 'date/'; 942 935 break; … … 964 957 $structure = $this->get_date_permastruct($this->permalink_structure); 965 958 966 if ( empty($structure)) {959 if ( empty($structure) ) 967 960 return false; 968 }969 961 970 962 $structure = str_replace('%monthnum%', '', $structure); … … 990 982 $structure = $this->get_date_permastruct($this->permalink_structure); 991 983 992 if ( empty($structure)) {984 if ( empty($structure) ) 993 985 return false; 994 }995 986 996 987 $structure = str_replace('%day%', '', $structure); … … 1029 1020 */ 1030 1021 function get_category_permastruct() { 1031 if ( isset($this->category_structure)) {1022 if ( isset($this->category_structure) ) 1032 1023 return $this->category_structure; 1033 } 1034 1035 if (empty($this->permalink_structure)) { 1024 1025 if ( empty($this->permalink_structure) ) { 1036 1026 $this->category_structure = ''; 1037 1027 return false; 1038 1028 } 1039 1029 1040 if ( empty($this->category_base))1030 if ( empty($this->category_base) ) 1041 1031 $this->category_structure = trailingslashit( $this->front . 'category' ); 1042 1032 else … … 1062 1052 */ 1063 1053 function get_tag_permastruct() { 1064 if ( isset($this->tag_structure)) {1054 if ( isset($this->tag_structure) ) 1065 1055 return $this->tag_structure; 1066 } 1067 1068 if (empty($this->permalink_structure)) { 1056 1057 if ( empty($this->permalink_structure) ) { 1069 1058 $this->tag_structure = ''; 1070 1059 return false; 1071 1060 } 1072 1061 1073 if ( empty($this->tag_base))1062 if ( empty($this->tag_base) ) 1074 1063 $this->tag_structure = trailingslashit( $this->front . 'tag' ); 1075 1064 else … … 1093 1082 if ( empty($this->permalink_structure) ) 1094 1083 return false; 1084 1095 1085 if ( isset($this->extra_permastructs[$name]) ) 1096 1086 return $this->extra_permastructs[$name]; 1087 1097 1088 return false; 1098 1089 } … … 1111 1102 */ 1112 1103 function get_author_permastruct() { 1113 if ( isset($this->author_structure)) {1104 if ( isset($this->author_structure) ) 1114 1105 return $this->author_structure; 1115 } 1116 1117 if (empty($this->permalink_structure)) { 1106 1107 if ( empty($this->permalink_structure) ) { 1118 1108 $this->author_structure = ''; 1119 1109 return false; … … 1138 1128 */ 1139 1129 function get_search_permastruct() { 1140 if ( isset($this->search_structure)) {1130 if ( isset($this->search_structure) ) 1141 1131 return $this->search_structure; 1142 } 1143 1144 if (empty($this->permalink_structure)) { 1132 1133 if ( empty($this->permalink_structure) ) { 1145 1134 $this->search_structure = ''; 1146 1135 return false; … … 1165 1154 */ 1166 1155 function get_page_permastruct() { 1167 if ( isset($this->page_structure)) {1156 if ( isset($this->page_structure) ) 1168 1157 return $this->page_structure; 1169 }1170 1158 1171 1159 if (empty($this->permalink_structure)) { … … 1192 1180 */ 1193 1181 function get_feed_permastruct() { 1194 if ( isset($this->feed_structure)) {1182 if ( isset($this->feed_structure) ) 1195 1183 return $this->feed_structure; 1196 } 1197 1198 if (empty($this->permalink_structure)) { 1184 1185 if ( empty($this->permalink_structure) ) { 1199 1186 $this->feed_structure = ''; 1200 1187 return false; … … 1219 1206 */ 1220 1207 function get_comment_feed_permastruct() { 1221 if ( isset($this->comment_feed_structure)) {1208 if ( isset($this->comment_feed_structure) ) 1222 1209 return $this->comment_feed_structure; 1223 }1224 1210 1225 1211 if (empty($this->permalink_structure)) { … … 1284 1270 //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/? 1285 1271 $feedregex2 = ''; 1286 foreach ( (array) $this->feeds as $feed_name) {1272 foreach ( (array) $this->feeds as $feed_name) 1287 1273 $feedregex2 .= $feed_name . '|'; 1288 }1289 1274 $feedregex2 = '(' . trim($feedregex2, '|') . ')/?$'; 1275 1290 1276 //$feedregex is identical but with /feed/ added on as well, so URLs like <permalink>/feed/atom 1291 1277 //and <permalink>/atom are both possible … … 1298 1284 1299 1285 //build up an array of endpoint regexes to append => queries to append 1300 if ( $endpoints) {1286 if ( $endpoints ) { 1301 1287 $ep_query_append = array (); 1302 1288 foreach ( (array) $this->endpoints as $endpoint) { … … 1321 1307 //build a list from the rewritecode and queryreplace arrays, that will look something like 1322 1308 //tagname=$matches[i] where i is the current $i 1323 for ( $i = 0; $i < $num_tokens; ++$i) {1324 if ( 0 < $i) {1309 for ( $i = 0; $i < $num_tokens; ++$i ) { 1310 if ( 0 < $i ) 1325 1311 $queries[$i] = $queries[$i - 1] . '&'; 1326 } else {1312 else 1327 1313 $queries[$i] = ''; 1328 }1329 1314 1330 1315 $query_token = str_replace($this->rewritecode, $this->queryreplace, $tokens[0][$i]) . $this->preg_index($i+1); … … 1334 1319 //get the structure, minus any cruft (stuff that isn't tags) at the front 1335 1320 $structure = $permalink_structure; 1336 if ( $front != '/') {1321 if ( $front != '/' ) 1337 1322 $structure = str_replace($front, '', $structure); 1338 } 1323 1339 1324 //create a list of dirs to walk over, making rewrite rules for each level 1340 1325 //so for example, a $structure of /%year%/%month%/%postname% would create 1341 1326 //rewrite rules for /%year%/, /%year%/%month%/ and /%year%/%month%/%postname% 1342 1327 $structure = trim($structure, '/'); 1343 if ($walk_dirs) { 1344 $dirs = explode('/', $structure); 1345 } else { 1346 $dirs[] = $structure; 1347 } 1328 $dirs = $walk_dirs ? explode('/', $structure) : array( $structure ); 1348 1329 $num_dirs = count($dirs); 1349 1330 … … 1354 1335 $post_rewrite = array(); 1355 1336 $struct = $front; 1356 for ( $j = 0; $j < $num_dirs; ++$j) {1337 for ( $j = 0; $j < $num_dirs; ++$j ) { 1357 1338 //get the struct for this dir, and trim slashes off the front 1358 1339 $struct .= $dirs[$j] . '/'; //accumulate. see comment near explode('/', $structure) above 1359 1340 $struct = ltrim($struct, '/'); 1341 1360 1342 //replace tags with regexes 1361 1343 $match = str_replace($this->rewritecode, $this->rewritereplace, $struct); 1344 1362 1345 //make a list of tags, and store how many there are in $num_toks 1363 1346 $num_toks = preg_match_all('/%.+?%/', $struct, $toks); 1347 1364 1348 //get the 'tagname=$matches[i]' 1365 1349 $query = ( isset($queries) && is_array($queries) ) ? $queries[$num_toks - 1] : ''; 1366 1350 1367 1351 //set up $ep_mask_specific which is used to match more specific URL types 1368 switch ($dirs[$j]) { 1369 case '%year%': $ep_mask_specific = EP_YEAR; break; 1370 case '%monthnum%': $ep_mask_specific = EP_MONTH; break; 1371 case '%day%': $ep_mask_specific = EP_DAY; break; 1352 switch ( $dirs[$j] ) { 1353 case '%year%': 1354 $ep_mask_specific = EP_YEAR; 1355 break; 1356 case '%monthnum%': 1357 $ep_mask_specific = EP_MONTH; 1358 break; 1359 case '%day%': 1360 $ep_mask_specific = EP_DAY; 1361 break; 1372 1362 } 1373 1363 … … 1395 1385 1396 1386 //if asked to, turn the feed queries into comment feed ones 1397 if ( $forcomments) {1387 if ( $forcomments ) { 1398 1388 $feedquery .= '&withcomments=1'; 1399 1389 $feedquery2 .= '&withcomments=1'; … … 1402 1392 //start creating the array of rewrites for this dir 1403 1393 $rewrite = array(); 1404 if ( $feed) //...adding on /feed/ regexes => queries1394 if ( $feed ) //...adding on /feed/ regexes => queries 1405 1395 $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2); 1406 if ( $paged) //...and /page/xx ones1396 if ( $paged ) //...and /page/xx ones 1407 1397 $rewrite = array_merge($rewrite, array($pagematch => $pagequery)); 1408 1398 … … 1414 1404 1415 1405 //do endpoints 1416 if ( $endpoints) {1406 if ( $endpoints ) { 1417 1407 foreach ( (array) $ep_query_append as $regex => $ep) { 1418 1408 //add the endpoints on if the mask fits 1419 if ( $ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) {1409 if ( $ep[0] & $ep_mask || $ep[0] & $ep_mask_specific ) 1420 1410 $rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2); 1421 }1422 1411 } 1423 1412 } 1424 1413 1425 1414 //if we've got some tags in this dir 1426 if ( $num_toks) {1415 if ( $num_toks ) { 1427 1416 $post = false; 1428 1417 $page = false; … … 1432 1421 //2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and 1433 1422 //minute all present). Set these flags now as we need them for the endpoints. 1434 if (strpos($struct, '%postname%') !== false || strpos($struct, '%post_id%') !== false 1423 if ( strpos($struct, '%postname%') !== false 1424 || strpos($struct, '%post_id%') !== false 1435 1425 || strpos($struct, '%pagename%') !== false 1436 || (strpos($struct, '%year%') !== false && strpos($struct, '%monthnum%') !== false && strpos($struct, '%day%') !== false && strpos($struct, '%hour%') !== false && strpos($struct, '%minute%') !== false && strpos($struct, '%second%') !== false)) { 1426 || (strpos($struct, '%year%') !== false && strpos($struct, '%monthnum%') !== false && strpos($struct, '%day%') !== false && strpos($struct, '%hour%') !== false && strpos($struct, '%minute%') !== false && strpos($struct, '%second%') !== false) 1427 ) { 1437 1428 $post = true; 1438 if ( strpos($struct, '%pagename%') !== false)1429 if ( strpos($struct, '%pagename%') !== false ) 1439 1430 $page = true; 1440 1431 } … … 1446 1437 $post = true; 1447 1438 $page = false; 1439 break; 1448 1440 } 1449 1441 } … … 1451 1443 1452 1444 //if we're creating rules for a permalink, do all the endpoints like attachments etc 1453 if ($post) { 1454 $post = true; 1445 if ( $post ) { 1455 1446 //create query and regex for trackback 1456 1447 $trackbackmatch = $match . $trackbackregex; … … 1459 1450 $match = rtrim($match, '/'); 1460 1451 //get rid of brackets 1461 $submatchbase = str_replace( array('(',')'),'',$match);1452 $submatchbase = str_replace( array('(', ')'), '', $match); 1462 1453 1463 1454 //add a rule for at attachments, which take the form of <permalink>/some-text … … 1485 1476 1486 1477 //do endpoints for attachments 1487 if ( !empty($endpoints) ) { foreach ( (array) $ep_query_append as $regex => $ep ) { 1488 if ($ep[0] & EP_ATTACHMENT) { 1489 $rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2); 1490 $rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2); 1478 if ( !empty($endpoints) ) { 1479 foreach ( (array) $ep_query_append as $regex => $ep ) { 1480 if ( $ep[0] & EP_ATTACHMENT ) { 1481 $rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2); 1482 $rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2); 1483 } 1491 1484 } 1492 } }1485 } 1493 1486 1494 1487 //now we've finished with endpoints, finish off the $sub1 and $sub2 matches … … 1511 1504 1512 1505 //if we're matching a permalink, add those extras (attachments etc) on 1513 if ( $post) {1506 if ( $post ) { 1514 1507 //add trackback 1515 1508 $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite); … … 1567 1560 $rewrite = array(); 1568 1561 1569 if ( empty($this->permalink_structure)) {1562 if ( empty($this->permalink_structure) ) 1570 1563 return $rewrite; 1571 }1572 1564 1573 1565 // robots.txt … … 1575 1567 1576 1568 //Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category% 1577 $default_feeds = array( '.*wp-atom.php$' => $this->index . '?feed=atom',1578 '.*wp-rdf.php$' => $this->index .'?feed=rdf',1579 '.*wp-rss.php$' => $this->index .'?feed=rss',1580 '.*wp-rss2.php$' => $this->index . '?feed=rss2',1581 '.*wp-feed.php$' => $this->index . '?feed=feed',1569 $default_feeds = array( '.*wp-atom.php$' => $this->index . '?feed=atom', 1570 '.*wp-rdf.php$' => $this->index . '?feed=rdf', 1571 '.*wp-rss.php$' => $this->index . '?feed=rss', 1572 '.*wp-rss2.php$' => $this->index . '?feed=rss2', 1573 '.*wp-feed.php$' => $this->index . '?feed=feed', 1582 1574 '.*wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1'); 1583 1575 … … 1675 1667 */ 1676 1668 function mod_rewrite_rules() { 1677 if ( ! $this->using_permalinks() ) {1669 if ( ! $this->using_permalinks() ) 1678 1670 return ''; 1679 }1680 1671 1681 1672 $site_root = parse_url(get_option('siteurl')); 1682 if ( isset( $site_root['path'] ) ) {1673 if ( isset( $site_root['path'] ) ) 1683 1674 $site_root = trailingslashit($site_root['path']); 1684 }1685 1675 1686 1676 $home_root = parse_url(home_url()); 1687 if ( isset( $home_root['path'] ) ) {1677 if ( isset( $home_root['path'] ) ) 1688 1678 $home_root = trailingslashit($home_root['path']); 1689 } else {1679 else 1690 1680 $home_root = '/'; 1691 }1692 1681 1693 1682 $rules = "<IfModule mod_rewrite.c>\n"; … … 1703 1692 // If the match is unanchored and greedy, prepend rewrite conditions 1704 1693 // to avoid infinite redirects and eclipsing of real files. 1705 if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {1694 //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) { 1706 1695 //nada. 1707 }1696 //} 1708 1697 1709 1698 $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; 1710 1699 } 1711 1700 1712 if ( $this->use_verbose_rules) {1701 if ( $this->use_verbose_rules ) { 1713 1702 $this->matches = ''; 1714 1703 $rewrite = $this->rewrite_rules(); … … 1724 1713 // If the match is unanchored and greedy, prepend rewrite conditions 1725 1714 // to avoid infinite redirects and eclipsing of real files. 1726 if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {1715 //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) { 1727 1716 //nada. 1728 }1729 1730 if ( strpos($query, $this->index) !== false) {1717 //} 1718 1719 if ( strpos($query, $this->index) !== false ) 1731 1720 $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; 1732 } else {1721 else 1733 1722 $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n"; 1734 }1735 1723 } 1736 1724 } else { … … 1761 1749 function iis7_url_rewrite_rules($add_parent_tags = false, $indent = " ", $end_of_line = "\n") { 1762 1750 1763 if ( ! $this->using_permalinks() ) {1751 if ( ! $this->using_permalinks() ) 1764 1752 return ''; 1765 }1766 1753 1767 1754 if ( !is_multisite() ) { … … 1794 1781 $siteurl = get_option( 'siteurl' ); 1795 1782 $siteurl_len = strlen( $siteurl ); 1796 if ( defined( 'WP_CONTENT_URL' ) &&substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len )1783 if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len ) 1797 1784 $content_path = substr( WP_CONTENT_URL, $siteurl_len + 1 ); 1798 1785 else … … 1864 1851 $index = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?')); 1865 1852 $front = substr($redirect, 0, $index); 1866 if ( $front != $this->index) { //it doesn't redirect to WP's index.php1853 if ( $front != $this->index ) { //it doesn't redirect to WP's index.php 1867 1854 $this->add_external_rule($regex, $redirect); 1868 1855 } else { … … 1961 1948 $this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%')); 1962 1949 $this->root = ''; 1963 if ( $this->using_index_permalinks()) {1950 if ( $this->using_index_permalinks() ) 1964 1951 $this->root = $this->index . '/'; 1965 }1966 1952 $this->category_base = get_option( 'category_base' ); 1967 1953 $this->tag_base = get_option( 'tag_base' ); … … 1998 1984 */ 1999 1985 function set_permalink_structure($permalink_structure) { 2000 if ( $permalink_structure != $this->permalink_structure) {1986 if ( $permalink_structure != $this->permalink_structure ) { 2001 1987 update_option('permalink_structure', $permalink_structure); 2002 1988 $this->init(); … … 2018 2004 */ 2019 2005 function set_category_base($category_base) { 2020 if ( $category_base != $this->category_base) {2006 if ( $category_base != $this->category_base ) { 2021 2007 update_option('category_base', $category_base); 2022 2008 $this->init();
Note: See TracChangeset
for help on using the changeset viewer.