[wp-cvs] wordpress/wp-includes functions.php,1.194,1.195
Ryan Boren
rboren at users.sourceforge.net
Fri Oct 15 03:16:03 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26217/wp-includes
Modified Files:
functions.php
Log Message:
If the match is unanchored and greedy, prepend rewrite conditions to avoid infinite redirects and eclipsing of real files. Add L to rewrite flags to break out of rewriting once a match is found.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.194
retrieving revision 1.195
diff -C2 -d -r1.194 -r1.195
*** functions.php 14 Oct 2004 08:27:56 -0000 1.194
--- functions.php 15 Oct 2004 03:16:01 -0000 1.195
***************
*** 1515,1522 ****
$match = str_replace('.+?', '.+', $match);
if (strstr($query, 'index.php')) {
! $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA]\n";
} else {
! $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA]\n";
}
}
--- 1515,1529 ----
$match = str_replace('.+?', '.+', $match);
+ // If the match is unanchored and greedy, prepend rewrite conditions
+ // to avoid infinite redirects and eclipsing of real files.
+ if ($match == '(.+)/?$') {
+ $rules .= "RewriteCond %{REQUEST_FILENAME} !-f\n" .
+ "RewriteCond %{REQUEST_FILENAME} !-d\n";
+ }
+
if (strstr($query, 'index.php')) {
! $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
} else {
! $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n";
}
}
More information about the cvs
mailing list