summaryrefslogtreecommitdiffstats
path: root/wp-includes/rewrite.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-08-13 15:13:05 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-08-13 15:13:05 +0000
commitbfa3b629e0d67016ec83050c5db762479af40609 (patch)
tree4c9ae204172d0fad3ae056ccc65ffe9ea91134d2 /wp-includes/rewrite.php
parent7258ea2d7eeedb439607b72a1f74dee98e4b9d12 (diff)
downloadwordpress-mu-bfa3b629e0d67016ec83050c5db762479af40609.tar.gz
wordpress-mu-bfa3b629e0d67016ec83050c5db762479af40609.tar.xz
wordpress-mu-bfa3b629e0d67016ec83050c5db762479af40609.zip
Merge with WP revision 8635
git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1421 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/rewrite.php')
-rw-r--r--wp-includes/rewrite.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php
index 8a13a33..15247d8 100644
--- a/wp-includes/rewrite.php
+++ b/wp-includes/rewrite.php
@@ -67,8 +67,10 @@ function add_rewrite_endpoint($name, $places) {
* @author Mark Jaquith
*/
function _wp_filter_taxonomy_base( $base ) {
- if ( !empty( $base ) )
- $base = preg_replace( '|^/index\.php/|', '/', $base );
+ if ( !empty( $base ) ) {
+ $base = preg_replace( '|^/index\.php/|', '', $base );
+ $base = trim( $base, '/' );
+ }
return $base;
}
@@ -150,7 +152,7 @@ function url_to_postid($url) {
$query = preg_replace("!^.+\?!", '', $query);
// Substitute the substring matches into the query.
- eval("\$query = \"$query\";");
+ eval("\$query = \"" . addslashes($query) . "\";");
// Filter out non-public query vars
global $wp;
parse_str($query, $query_vars);
@@ -445,9 +447,9 @@ class WP_Rewrite {
}
if (empty($this->category_base))
- $this->category_structure = $this->front . 'category/';
+ $this->category_structure = trailingslashit( $this->front . 'category' );
else
- $this->category_structure = $this->category_base . '/';
+ $this->category_structure = trailingslashit( '/' . $this->root . $this->category_base );
$this->category_structure .= '%category%';
@@ -465,9 +467,9 @@ class WP_Rewrite {
}
if (empty($this->tag_base))
- $this->tag_structure = $this->front . 'tag/';
+ $this->tag_structure = trailingslashit( $this->front . 'tag' );
else
- $this->tag_structure = $this->tag_base . '/';
+ $this->tag_structure = trailingslashit( '/' . $this->root . $this->tag_base );
$this->tag_structure .= '%tag%';
@@ -993,8 +995,8 @@ class WP_Rewrite {
if ($this->using_index_permalinks()) {
$this->root = $this->index . '/';
}
- $this->category_base = ( ( $this->using_index_permalinks() ) ? '/' . $this->index : '' ) . get_option( 'category_base' );
- $this->tag_base = ( ( $this->using_index_permalinks() ) ? '/' . $this->index : '' ) . get_option( 'tag_base' );
+ $this->category_base = get_option( 'category_base' );
+ $this->tag_base = get_option( 'tag_base' );
unset($this->category_structure);
unset($this->author_structure);
unset($this->date_structure);