Changeset 34958
- Timestamp:
- 10/08/2015 09:23:31 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-rewrite.php
r34957 r34958 1243 1243 $robots_rewrite = ( empty( $home_path['path'] ) || '/' == $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array(); 1244 1244 1245 // Old feed and service files 1245 // Old feed and service files. 1246 1246 $deprecated_files = array( 1247 1247 '.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$' => $this->index . '?feed=old', … … 1249 1249 ); 1250 1250 1251 // Registration rules 1251 // Registration rules. 1252 1252 $registration_pages = array(); 1253 1253 if ( is_multisite() && is_main_site() ) { … … 1255 1255 $registration_pages['.*wp-activate.php$'] = $this->index . '?activate=true'; 1256 1256 } 1257 $registration_pages['.*wp-register.php$'] = $this->index . '?register=true'; // Deprecated 1257 1258 // Deprecated. 1259 $registration_pages['.*wp-register.php$'] = $this->index . '?register=true'; 1258 1260 1259 1261 // Post rewrite rules. … … 1476 1478 $rules .= "RewriteEngine On\n"; 1477 1479 $rules .= "RewriteBase $home_root\n"; 1478 $rules .= "RewriteRule ^index\.php$ - [L]\n"; // Prevent -f checks on index.php. 1479 1480 //add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all) 1480 1481 // Prevent -f checks on index.php. 1482 $rules .= "RewriteRule ^index\.php$ - [L]\n"; 1483 1484 // Add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all). 1481 1485 foreach ( (array) $this->non_wp_rules as $match => $query) { 1482 1486 // Apache 1.3 does not support the reluctant (non-greedy) modifier. 1483 1487 $match = str_replace('.+?', '.+', $match); 1484 1485 // If the match is unanchored and greedy, prepend rewrite conditions1486 // to avoid infinite redirects and eclipsing of real files.1487 //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {1488 //nada.1489 //}1490 1488 1491 1489 $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; … … 1503 1501 // Apache 1.3 does not support the reluctant (non-greedy) modifier. 1504 1502 $match = str_replace('.+?', '.+', $match); 1505 1506 // If the match is unanchored and greedy, prepend rewrite conditions1507 // to avoid infinite redirects and eclipsing of real files.1508 //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {1509 //nada.1510 //}1511 1503 1512 1504 if ( strpos($query, $this->index) !== false ) … … 1524 1516 1525 1517 /** 1526 *1527 1518 * Filter the list of rewrite rules formatted for output to an .htaccess file. 1528 1519 * … … 1620 1611 } 1621 1612 1622 // "external" = it doesn't correspond to index.php 1613 // "external" = it doesn't correspond to index.php. 1623 1614 if ( $external ) { 1624 1615 $this->add_external_rule( $regex, $query ); … … 1665 1656 global $wp; 1666 1657 1667 // For backward compatibility, if `null`has explicitly been passed as `$query_var`, assume `true`.1658 // For backward compatibility, if null has explicitly been passed as `$query_var`, assume `true`. 1668 1659 if ( true === $query_var || null === func_get_arg( 2 ) ) { 1669 1660 $query_var = $name; … … 1705 1696 */ 1706 1697 public function add_permastruct( $name, $struct, $args = array() ) { 1707 // backwards compatibility for the old parameters: $with_front and $ep_mask1698 // Backwards compatibility for the old parameters: $with_front and $ep_mask. 1708 1699 if ( ! is_array( $args ) ) 1709 1700 $args = array( 'with_front' => $args ); … … 1748 1739 static $do_hard_later = null; 1749 1740 1750 // Prevent this action from running before everyone has registered their rewrites 1741 // Prevent this action from running before everyone has registered their rewrites. 1751 1742 if ( ! did_action( 'wp_loaded' ) ) { 1752 1743 add_action( 'wp_loaded', array( $this, 'flush_rules' ) ); … … 1762 1753 delete_option('rewrite_rules'); 1763 1754 $this->wp_rewrite_rules(); 1755 1764 1756 /** 1765 1757 * Filter whether a "hard" rewrite rule flush should be performed when requested.
Note: See TracChangeset
for help on using the changeset viewer.