Better solution for #4536. Slashless normalization of tag/category bases. fixes #7306 for trunk. see #4536
git-svn-id: http://svn.automattic.com/wordpress/trunk@8365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -445,9 +447,8 @@ class WP_Rewrite {
|
||||
}
|
||||
|
||||
if (empty($this->category_base))
|
||||
$this->category_structure = $this->front . 'category/';
|
||||
else
|
||||
$this->category_structure = $this->category_base . '/';
|
||||
$this->category_base = 'category';
|
||||
$this->category_structure = trailingslashit( $this->front . $this->category_base );
|
||||
|
||||
$this->category_structure .= '%category%';
|
||||
|
||||
@@ -465,9 +466,8 @@ class WP_Rewrite {
|
||||
}
|
||||
|
||||
if (empty($this->tag_base))
|
||||
$this->tag_structure = $this->front . 'tag/';
|
||||
else
|
||||
$this->tag_structure = $this->tag_base . '/';
|
||||
$this->tag_base = 'tag';
|
||||
$this->tag_structure = trailingslashit( $this->front . $this->tag_base );
|
||||
|
||||
$this->tag_structure .= '%tag%';
|
||||
|
||||
@@ -993,8 +993,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);
|
||||
|
||||
@@ -15,6 +15,6 @@ $wp_version = '2.7-bleeding';
|
||||
*
|
||||
* @global int $wp_db_version
|
||||
*/
|
||||
$wp_db_version = 8201;
|
||||
$wp_db_version = 8202;
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user