Changes in trunk/wp-includes/rewrite.php [12061:12271]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rewrite.php
r12061 r12271 1061 1061 */ 1062 1062 function get_extra_permastruct($name) { 1063 if ( empty($this->permalink_structure) ) 1064 return false; 1063 1065 if ( isset($this->extra_permastructs[$name]) ) 1064 1066 return $this->extra_permastructs[$name]; … … 1443 1445 1444 1446 //do endpoints for attachments 1445 if ( !empty($endpoint ) ) { foreach ( (array) $ep_query_append as $regex => $ep ) {1447 if ( !empty($endpoints) ) { foreach ( (array) $ep_query_append as $regex => $ep ) { 1446 1448 if ($ep[0] & EP_ATTACHMENT) { 1447 $rewrite[$sub1 . $regex] = $subquery . '?' .$ep[1] . $this->preg_index(2);1448 $rewrite[$sub2 . $regex] = $subquery . '?' .$ep[1] . $this->preg_index(2);1449 $rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2); 1450 $rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2); 1449 1451 } 1450 1452 } } … … 1716 1718 * @return string 1717 1719 */ 1718 function iis7_url_rewrite_rules( ){1720 function iis7_url_rewrite_rules($add_parent_tags = false, $indent = " ", $end_of_line = "\n") { 1719 1721 1720 1722 if ( ! $this->using_permalinks()) { 1721 1723 return ''; 1722 1724 } 1723 $rules = "<rule name=\"wordpress\" patternSyntax=\"Wildcard\">\n"; 1724 $rules .= " <match url=\"*\" />\n"; 1725 $rules .= " <conditions>\n"; 1726 $rules .= " <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" />\n"; 1727 $rules .= " <add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" />\n"; 1728 $rules .= " </conditions>\n"; 1729 $rules .= " <action type=\"Rewrite\" url=\"index.php\" />\n"; 1730 $rules .= "</rule>"; 1725 1726 $rules = ''; 1727 $extra_indent = ''; 1728 if ( $add_parent_tags ) { 1729 $rules .= "<configuration>".$end_of_line; 1730 $rules .= $indent."<system.webServer>".$end_of_line; 1731 $rules .= $indent.$indent."<rewrite>".$end_of_line; 1732 $rules .= $indent.$indent.$indent."<rules>".$end_of_line; 1733 $extra_indent = $indent.$indent.$indent.$indent; 1734 } 1735 1736 $rules .= $extra_indent."<rule name=\"wordpress\" patternSyntax=\"Wildcard\">".$end_of_line; 1737 $rules .= $extra_indent.$indent."<match url=\"*\" />".$end_of_line; 1738 $rules .= $extra_indent.$indent.$indent."<conditions>".$end_of_line; 1739 $rules .= $extra_indent.$indent.$indent.$indent."<add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" />".$end_of_line; 1740 $rules .= $extra_indent.$indent.$indent.$indent."<add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" />".$end_of_line; 1741 $rules .= $extra_indent.$indent.$indent."</conditions>".$end_of_line; 1742 $rules .= $extra_indent.$indent."<action type=\"Rewrite\" url=\"index.php\" />".$end_of_line; 1743 $rules .= $extra_indent."</rule>"; 1744 1745 if ( $add_parent_tags ) { 1746 $rules .= $end_of_line.$indent.$indent.$indent."</rules>".$end_of_line; 1747 $rules .= $indent.$indent."</rewrite>".$end_of_line; 1748 $rules .= $indent."</system.webServer>".$end_of_line; 1749 $rules .= "</configuration>"; 1750 } 1731 1751 1732 1752 $rules = apply_filters('iis7_url_rewrite_rules', $rules);
Note: See TracChangeset
for help on using the changeset viewer.