Changeset 2635
- Timestamp:
- 06/13/2005 02:09:24 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r2627 r2635 627 627 628 628 if ($this->is_category) { 629 $category = &get_category($this->get('cat')); 629 $cat = $this->get('cat'); 630 $category = &get_category($cat); 630 631 $this->queried_object = &$category; 631 $this->queried_object_id = $ this->get('cat');632 $this->queried_object_id = $cat; 632 633 } else if ($this->is_single) { 633 634 $this->queried_object = $this->post; … … 754 755 var $matches = ''; 755 756 var $rules; 757 var $use_verbose_rules = false; 756 758 var $rewritecode = 757 759 array( … … 1220 1222 $rules .= "RewriteEngine On\n"; 1221 1223 $rules .= "RewriteBase $home_root\n"; 1222 $this->matches = ''; 1223 $rewrite = $this->rewrite_rules(); 1224 $num_rules = count($rewrite); 1225 $rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n" . 1226 "RewriteCond %{REQUEST_FILENAME} -d\n" . 1227 "RewriteRule ^.*$ - [S=$num_rules]\n"; 1228 1229 foreach ($rewrite as $match => $query) { 1230 // Apache 1.3 does not support the reluctant (non-greedy) modifier. 1231 $match = str_replace('.+?', '.+', $match); 1232 1233 // If the match is unanchored and greedy, prepend rewrite conditions 1234 // to avoid infinite redirects and eclipsing of real files. 1235 if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) { 1236 //nada. 1237 } 1238 1239 if (strstr($query, $this->index)) { 1240 $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; 1241 } else { 1242 $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n"; 1243 } 1244 } 1224 1225 if ($this->use_verbose_rules) { 1226 $this->matches = ''; 1227 $rewrite = $this->rewrite_rules(); 1228 $num_rules = count($rewrite); 1229 $rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n" . 1230 "RewriteCond %{REQUEST_FILENAME} -d\n" . 1231 "RewriteRule ^.*$ - [S=$num_rules]\n"; 1232 1233 foreach ($rewrite as $match => $query) { 1234 // Apache 1.3 does not support the reluctant (non-greedy) modifier. 1235 $match = str_replace('.+?', '.+', $match); 1236 1237 // If the match is unanchored and greedy, prepend rewrite conditions 1238 // to avoid infinite redirects and eclipsing of real files. 1239 if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) { 1240 //nada. 1241 } 1242 1243 if (strstr($query, $this->index)) { 1244 $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; 1245 } else { 1246 $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n"; 1247 } 1248 } 1249 } else { 1250 $rules .= "RewriteCond %{REQUEST_FILENAME} !-f\n" . 1251 "RewriteCond %{REQUEST_FILENAME} !-d\n" . 1252 "RewriteRule . {$home_root}{$this->index}\n"; 1253 } 1254 1245 1255 $rules .= "</IfModule>\n"; 1246 1256 … … 1304 1314 parse_str($extra_query_vars, $extra_query_vars); 1305 1315 1306 // Process PATH_INFO and 404.1316 // Process PATH_INFO, REQUEST_URI, and 404 for permalinks. 1307 1317 if ((isset($_GET['error']) && $_GET['error'] == '404') || 1308 1318 ((! empty($_SERVER['PATH_INFO'])) && 1309 1319 ('/' != $_SERVER['PATH_INFO']) && 1310 1320 (false === strpos($_SERVER['PATH_INFO'], '.php')) 1311 )) { 1321 ) || 1322 (empty($_SERVER['QUERY_STRING']) && 1323 (false === strpos($_SERVER['REQUEST_URI'], '.php')) && 1324 ('/' != $_SERVER['REQUEST_URI'])) 1325 ) { 1312 1326 1313 1327 $this->did_permalink = true;
Note: See TracChangeset
for help on using the changeset viewer.