Changeset 8572 for trunk/wp-includes/rewrite.php
- Timestamp:
- 08/06/2008 08:31:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rewrite.php
r8510 r8572 158 158 parse_str($query, $query_vars); 159 159 $query = array(); 160 foreach ( $query_vars as $key => $value ) {160 foreach ( (array) $query_vars as $key => $value ) { 161 161 if ( in_array($key, $wp->public_query_vars) ) 162 162 $query[$key] = $value; … … 391 391 preg_match_all('/%.+?%/', $this->permalink_structure, $tokens); 392 392 $tok_index = 1; 393 foreach ( $tokens[0] as $token) {393 foreach ( (array) $tokens[0] as $token) { 394 394 if ( ($token == '%post_id%') && ($tok_index <= 3) ) { 395 395 $front = $front . 'date/'; … … 575 575 //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/? 576 576 $feedregex2 = ''; 577 foreach ( $this->feeds as $feed_name) {577 foreach ( (array) $this->feeds as $feed_name) { 578 578 $feedregex2 .= $feed_name . '|'; 579 579 } … … 590 590 if ($endpoints) { 591 591 $ep_query_append = array (); 592 foreach ( $this->endpoints as $endpoint) {592 foreach ( (array) $this->endpoints as $endpoint) { 593 593 //match everything after the endpoint name, but allow for nothing to appear there 594 594 $epmatch = $endpoint[1] . '(/(.*))?/?$'; … … 689 689 //do endpoints 690 690 if ($endpoints) { 691 foreach ( $ep_query_append as $regex => $ep) {691 foreach ( (array) $ep_query_append as $regex => $ep) { 692 692 //add the endpoints on if the mask fits 693 693 if ($ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) { … … 746 746 747 747 //do endpoints for attachments 748 if ( ! empty($endpoint) ) { foreach ($ep_query_append as $regex => $ep) {748 if ( !empty($endpoint) ) { foreach ( (array) $ep_query_append as $regex => $ep ) { 749 749 if ($ep[0] & EP_ATTACHMENT) { 750 750 $rewrite[$sub1 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); … … 894 894 895 895 //add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all) 896 foreach ( $this->non_wp_rules as $match => $query) {896 foreach ( (array) $this->non_wp_rules as $match => $query) { 897 897 // Apache 1.3 does not support the reluctant (non-greedy) modifier. 898 898 $match = str_replace('.+?', '.+', $match); … … 915 915 "RewriteRule ^.*$ - [S=$num_rules]\n"; 916 916 917 foreach ( $rewrite as $match => $query) {917 foreach ( (array) $rewrite as $match => $query) { 918 918 // Apache 1.3 does not support the reluctant (non-greedy) modifier. 919 919 $match = str_replace('.+?', '.+', $match);
Note: See TracChangeset
for help on using the changeset viewer.