WordPress.org

Make WordPress Core

Changeset 8366


Ignore:
Timestamp:
07/17/2008 07:45:26 PM (10 years ago)
Author:
markjaquith
Message:

Better solution for #4536. Slashless normalization of tag/category bases. fixes #7306 for 2.6.1. see #4536

Location:
branches/2.6
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/wp-admin/options-permalink.php

    r7883 r8366  
    164164<h3><?php _e('Optional'); ?></h3>
    165165<?php if ($is_apache) : ?>
    166     <p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
     166    <p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>topics</code> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
    167167<?php else : ?>
    168     <p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/index.php/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
     168    <p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>topics</code> as your category base would make your category links like <code>http://example.org/index.php/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
    169169<?php endif; ?>
    170170
  • branches/2.6/wp-includes/rewrite.php

    r8213 r8366  
    6868  */
    6969function _wp_filter_taxonomy_base( $base ) {
    70     if ( !empty( $base ) )
    71         $base = preg_replace( '|^/index\.php/|', '/', $base );
     70    if ( !empty( $base ) ) {
     71        $base = preg_replace( '|^/index\.php/|', '', $base );
     72        $base = trim( $base, '/' );
     73    }
    7274    return $base;
    7375}
     
    446448
    447449        if (empty($this->category_base))
    448             $this->category_structure = $this->front . 'category/';
    449         else
    450             $this->category_structure = $this->category_base . '/';
     450            $this->category_base = 'category';
     451        $this->category_structure = trailingslashit( $this->front . $this->category_base );
    451452
    452453        $this->category_structure .= '%category%';
     
    466467
    467468        if (empty($this->tag_base))
    468             $this->tag_structure = $this->front . 'tag/';
    469         else
    470             $this->tag_structure = $this->tag_base . '/';
     469            $this->tag_base = 'tag';
     470        $this->tag_structure = trailingslashit( $this->front . $this->tag_base );
    471471
    472472        $this->tag_structure .= '%tag%';
     
    994994            $this->root = $this->index . '/';
    995995        }
    996         $this->category_base = ( ( $this->using_index_permalinks() ) ? '/' . $this->index : '' ) . get_option( 'category_base' );
    997         $this->tag_base = ( ( $this->using_index_permalinks() ) ? '/' . $this->index : '' ) . get_option( 'tag_base' );
     996        $this->category_base = get_option( 'category_base' );
     997        $this->tag_base = get_option( 'tag_base' );
    998998        unset($this->category_structure);
    999999        unset($this->author_structure);
  • branches/2.6/wp-includes/version.php

    r8343 r8366  
    1616 * @global int $wp_db_version
    1717 */
    18 $wp_db_version = 8201;
     18$wp_db_version = 8202;
    1919
    2020?>
Note: See TracChangeset for help on using the changeset viewer.