Make WordPress Core

Changeset 13689


Ignore:
Timestamp:
03/13/2010 07:29:10 AM (16 years ago)
Author:
dd32
Message:

Whitespace additions to WP_Rewrite. A few coding standards too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/rewrite.php

    r13688 r13689  
    3535function add_rewrite_tag($tagname, $regex) {
    3636    //validation
    37     if (strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%') {
     37    if ( strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%' )
    3838        return;
    39     }
    4039
    4140    $qv = trim($tagname, '%');
     
    7271function add_feed($feedname, $function) {
    7372    global $wp_rewrite;
    74     if (!in_array($feedname, $wp_rewrite->feeds)) { //override the file if it is
     73    if ( ! in_array($feedname, $wp_rewrite->feeds) ) //override the file if it is
    7574        $wp_rewrite->feeds[] = $feedname;
    76     }
    7775    $hook = 'do_feed_' . $feedname;
    7876    // Remove default function hook
     
    9694}
    9795
     96//pseudo-places
     97/**
     98 * Endpoint Mask for default, which is nothing.
     99 *
     100 * @since 2.1.0
     101 */
     102define('EP_NONE', 0);
     103
    98104/**
    99105 * Endpoint Mask for Permalink.
     
    186192 */
    187193define('EP_PAGES', 4096);
    188 
    189 //pseudo-places
    190 /**
    191  * Endpoint Mask for default, which is nothing.
    192  *
    193  * @since 2.1.0
    194  */
    195 define('EP_NONE', 0);
    196194
    197195/**
     
    260258    if ( preg_match('#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values) )   {
    261259        $id = absint($values[2]);
    262         if ($id)
     260        if ( $id )
    263261            return $id;
    264262    }
     
    315313    // Look for matches.
    316314    $request_match = $request;
    317     foreach ($rewrite as $match => $query) {
     315    foreach ( (array)$rewrite as $match => $query) {
    318316        // If the requesting file is the anchor of the match, prepend it
    319317        // to the path info.
    320         if ( (! empty($url)) && (strpos($match, $url) === 0) && ($url != $request)) {
     318        if ( !empty($url) && ($url != $request) && (strpos($match, $url) === 0) )
    321319            $request_match = $url . '/' . $request;
    322         }
    323320
    324321        if ( preg_match("!^$match!", $request_match, $matches) ) {
     
    329326            // Substitute the substring matches into the query.
    330327            $query = addslashes(WP_MatchesMapRegex::apply($query, $matches));
     328
    331329            // Filter out non-public query vars
    332330            global $wp;
     
    337335                    $query[$key] = $value;
    338336            }
     337
    339338            // Do the query
    340339            $query = new WP_Query($query);
     
    725724     */
    726725    function using_permalinks() {
    727         if (empty($this->permalink_structure))
     726        return ! empty($this->permalink_structure);
     727    }
     728
     729    /**
     730     * Whether permalinks are being used and rewrite module is not enabled.
     731     *
     732     * Means that permalink links are enabled and index.php is in the URL.
     733     *
     734     * @since 1.5.0
     735     * @access public
     736     *
     737     * @return bool
     738     */
     739    function using_index_permalinks() {
     740        if ( empty($this->permalink_structure) )
    728741            return false;
    729         else
     742
     743        // If the index is not in the permalink, we're using mod_rewrite.
     744        if ( preg_match('#^/*' . $this->index . '#', $this->permalink_structure) )
    730745            return true;
    731     }
    732 
    733     /**
    734      * Whether permalinks are being used and rewrite module is not enabled.
    735      *
    736      * Means that permalink links are enabled and index.php is in the URL.
     746
     747        return false;
     748    }
     749
     750    /**
     751     * Whether permalinks are being used and rewrite module is enabled.
     752     *
     753     * Using permalinks and index.php is not in the URL.
    737754     *
    738755     * @since 1.5.0
     
    741758     * @return bool
    742759     */
    743     function using_index_permalinks() {
    744         if (empty($this->permalink_structure)) {
    745             return false;
    746         }
    747 
    748         // If the index is not in the permalink, we're using mod_rewrite.
    749         if (preg_match('#^/*' . $this->index . '#', $this->permalink_structure)) {
    750             return true;
    751         }
    752 
    753         return false;
    754     }
    755 
    756     /**
    757      * Whether permalinks are being used and rewrite module is enabled.
    758      *
    759      * Using permalinks and index.php is not in the URL.
    760      *
    761      * @since 1.5.0
    762      * @access public
    763      *
    764      * @return bool
    765      */
    766760    function using_mod_rewrite_permalinks() {
    767         if ( $this->using_permalinks() && ! $this->using_index_permalinks())
     761        if ( $this->using_permalinks() && ! $this->using_index_permalinks() )
    768762            return true;
    769763        else
     
    826820        $page_attachment_uris = array();
    827821
    828         foreach ($posts as $id => $post) {
     822        foreach ( $posts as $id => $post ) {
    829823            // URL => page name
    830824            $uri = get_page_uri($id);
    831825            $attachments = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $id ));
    832             if ( $attachments ) {
     826            if ( !empty($attachments) ) {
    833827                foreach ( $attachments as $attachment ) {
    834828                    $attach_uri = get_page_uri($attachment->ID);
     
    870864        $attachment_uris = $page_uris[1];
    871865
    872         if( is_array( $attachment_uris ) ) {
    873             foreach ($attachment_uris as $uri => $pagename) {
     866        if ( is_array( $attachment_uris ) ) {
     867            foreach ( $attachment_uris as $uri => $pagename ) {
    874868                $this->add_rewrite_tag('%pagename%', "($uri)", 'attachment=');
    875869                $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES));
    876870            }
    877871        }
    878         if( is_array( $uris ) ) {
    879             foreach ($uris as $uri => $pagename) {
     872        if ( is_array( $uris ) ) {
     873            foreach ( $uris as $uri => $pagename ) {
    880874                $this->add_rewrite_tag('%pagename%', "($uri)", 'pagename=');
    881875                $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES));
     
    907901     */
    908902    function get_date_permastruct() {
    909         if (isset($this->date_structure)) {
     903        if ( isset($this->date_structure) )
    910904            return $this->date_structure;
    911         }
    912 
    913         if (empty($this->permalink_structure)) {
     905
     906        if ( empty($this->permalink_structure) ) {
    914907            $this->date_structure = '';
    915908            return false;
     
    922915        $date_endian = '';
    923916
    924         foreach ($endians as $endian) {
    925             if (false !== strpos($this->permalink_structure, $endian)) {
     917        foreach ( $endians as $endian ) {
     918            if ( false !== strpos($this->permalink_structure, $endian) ) {
    926919                $date_endian= $endian;
    927920                break;
     
    938931        $tok_index = 1;
    939932        foreach ( (array) $tokens[0] as $token) {
    940             if ( ($token == '%post_id%') && ($tok_index <= 3) ) {
     933            if ( '%post_id%' == $token && ($tok_index <= 3) ) {
    941934                $front = $front . 'date/';
    942935                break;
     
    964957        $structure = $this->get_date_permastruct($this->permalink_structure);
    965958
    966         if (empty($structure)) {
     959        if ( empty($structure) )
    967960            return false;
    968         }
    969961
    970962        $structure = str_replace('%monthnum%', '', $structure);
     
    990982        $structure = $this->get_date_permastruct($this->permalink_structure);
    991983
    992         if (empty($structure)) {
     984        if ( empty($structure) )
    993985            return false;
    994         }
    995986
    996987        $structure = str_replace('%day%', '', $structure);
     
    10291020     */
    10301021    function get_category_permastruct() {
    1031         if (isset($this->category_structure)) {
     1022        if ( isset($this->category_structure) )
    10321023            return $this->category_structure;
    1033         }
    1034 
    1035         if (empty($this->permalink_structure)) {
     1024
     1025        if ( empty($this->permalink_structure) ) {
    10361026            $this->category_structure = '';
    10371027            return false;
    10381028        }
    10391029
    1040         if (empty($this->category_base))
     1030        if ( empty($this->category_base) )
    10411031            $this->category_structure = trailingslashit( $this->front . 'category' );
    10421032        else
     
    10621052     */
    10631053    function get_tag_permastruct() {
    1064         if (isset($this->tag_structure)) {
     1054        if ( isset($this->tag_structure) )
    10651055            return $this->tag_structure;
    1066         }
    1067 
    1068         if (empty($this->permalink_structure)) {
     1056
     1057        if ( empty($this->permalink_structure) ) {
    10691058            $this->tag_structure = '';
    10701059            return false;
    10711060        }
    10721061
    1073         if (empty($this->tag_base))
     1062        if ( empty($this->tag_base) )
    10741063            $this->tag_structure = trailingslashit( $this->front . 'tag' );
    10751064        else
     
    10931082        if ( empty($this->permalink_structure) )
    10941083            return false;
     1084
    10951085        if ( isset($this->extra_permastructs[$name]) )
    10961086            return $this->extra_permastructs[$name];
     1087
    10971088        return false;
    10981089    }
     
    11111102     */
    11121103    function get_author_permastruct() {
    1113         if (isset($this->author_structure)) {
     1104        if ( isset($this->author_structure) )
    11141105            return $this->author_structure;
    1115         }
    1116 
    1117         if (empty($this->permalink_structure)) {
     1106
     1107        if ( empty($this->permalink_structure) ) {
    11181108            $this->author_structure = '';
    11191109            return false;
     
    11381128     */
    11391129    function get_search_permastruct() {
    1140         if (isset($this->search_structure)) {
     1130        if ( isset($this->search_structure) )
    11411131            return $this->search_structure;
    1142         }
    1143 
    1144         if (empty($this->permalink_structure)) {
     1132
     1133        if ( empty($this->permalink_structure) ) {
    11451134            $this->search_structure = '';
    11461135            return false;
     
    11651154     */
    11661155    function get_page_permastruct() {
    1167         if (isset($this->page_structure)) {
     1156        if ( isset($this->page_structure) )
    11681157            return $this->page_structure;
    1169         }
    11701158
    11711159        if (empty($this->permalink_structure)) {
     
    11921180     */
    11931181    function get_feed_permastruct() {
    1194         if (isset($this->feed_structure)) {
     1182        if ( isset($this->feed_structure) )
    11951183            return $this->feed_structure;
    1196         }
    1197 
    1198         if (empty($this->permalink_structure)) {
     1184
     1185        if ( empty($this->permalink_structure) ) {
    11991186            $this->feed_structure = '';
    12001187            return false;
     
    12191206     */
    12201207    function get_comment_feed_permastruct() {
    1221         if (isset($this->comment_feed_structure)) {
     1208        if ( isset($this->comment_feed_structure) )
    12221209            return $this->comment_feed_structure;
    1223         }
    12241210
    12251211        if (empty($this->permalink_structure)) {
     
    12841270        //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/?
    12851271        $feedregex2 = '';
    1286         foreach ( (array) $this->feeds as $feed_name) {
     1272        foreach ( (array) $this->feeds as $feed_name)
    12871273            $feedregex2 .= $feed_name . '|';
    1288         }
    12891274        $feedregex2 = '(' . trim($feedregex2, '|') .  ')/?$';
     1275
    12901276        //$feedregex is identical but with /feed/ added on as well, so URLs like <permalink>/feed/atom
    12911277        //and <permalink>/atom are both possible
     
    12981284
    12991285        //build up an array of endpoint regexes to append => queries to append
    1300         if ($endpoints) {
     1286        if ( $endpoints ) {
    13011287            $ep_query_append = array ();
    13021288            foreach ( (array) $this->endpoints as $endpoint) {
     
    13211307        //build a list from the rewritecode and queryreplace arrays, that will look something like
    13221308        //tagname=$matches[i] where i is the current $i
    1323         for ($i = 0; $i < $num_tokens; ++$i) {
    1324             if (0 < $i) {
     1309        for ( $i = 0; $i < $num_tokens; ++$i ) {
     1310            if ( 0 < $i )
    13251311                $queries[$i] = $queries[$i - 1] . '&';
    1326             } else {
     1312            else
    13271313                $queries[$i] = '';
    1328             }
    13291314
    13301315            $query_token = str_replace($this->rewritecode, $this->queryreplace, $tokens[0][$i]) . $this->preg_index($i+1);
     
    13341319        //get the structure, minus any cruft (stuff that isn't tags) at the front
    13351320        $structure = $permalink_structure;
    1336         if ($front != '/') {
     1321        if ( $front != '/' )
    13371322            $structure = str_replace($front, '', $structure);
    1338         }
     1323
    13391324        //create a list of dirs to walk over, making rewrite rules for each level
    13401325        //so for example, a $structure of /%year%/%month%/%postname% would create
    13411326        //rewrite rules for /%year%/, /%year%/%month%/ and /%year%/%month%/%postname%
    13421327        $structure = trim($structure, '/');
    1343         if ($walk_dirs) {
    1344             $dirs = explode('/', $structure);
    1345         } else {
    1346             $dirs[] = $structure;
    1347         }
     1328        $dirs = $walk_dirs ? explode('/', $structure) : array( $structure );
    13481329        $num_dirs = count($dirs);
    13491330
     
    13541335        $post_rewrite = array();
    13551336        $struct = $front;
    1356         for ($j = 0; $j < $num_dirs; ++$j) {
     1337        for ( $j = 0; $j < $num_dirs; ++$j ) {
    13571338            //get the struct for this dir, and trim slashes off the front
    13581339            $struct .= $dirs[$j] . '/'; //accumulate. see comment near explode('/', $structure) above
    13591340            $struct = ltrim($struct, '/');
     1341
    13601342            //replace tags with regexes
    13611343            $match = str_replace($this->rewritecode, $this->rewritereplace, $struct);
     1344
    13621345            //make a list of tags, and store how many there are in $num_toks
    13631346            $num_toks = preg_match_all('/%.+?%/', $struct, $toks);
     1347
    13641348            //get the 'tagname=$matches[i]'
    13651349            $query = ( isset($queries) && is_array($queries) ) ? $queries[$num_toks - 1] : '';
    13661350
    13671351            //set up $ep_mask_specific which is used to match more specific URL types
    1368             switch ($dirs[$j]) {
    1369                 case '%year%': $ep_mask_specific = EP_YEAR; break;
    1370                 case '%monthnum%': $ep_mask_specific = EP_MONTH; break;
    1371                 case '%day%': $ep_mask_specific = EP_DAY; break;
     1352            switch ( $dirs[$j] ) {
     1353                case '%year%':
     1354                    $ep_mask_specific = EP_YEAR;
     1355                    break;
     1356                case '%monthnum%':
     1357                    $ep_mask_specific = EP_MONTH;
     1358                    break;
     1359                case '%day%':
     1360                    $ep_mask_specific = EP_DAY;
     1361                    break;
    13721362            }
    13731363
     
    13951385
    13961386            //if asked to, turn the feed queries into comment feed ones
    1397             if ($forcomments) {
     1387            if ( $forcomments ) {
    13981388                $feedquery .= '&withcomments=1';
    13991389                $feedquery2 .= '&withcomments=1';
     
    14021392            //start creating the array of rewrites for this dir
    14031393            $rewrite = array();
    1404             if ($feed) //...adding on /feed/ regexes => queries
     1394            if ( $feed ) //...adding on /feed/ regexes => queries
    14051395                $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2);
    1406             if ($paged) //...and /page/xx ones
     1396            if ( $paged ) //...and /page/xx ones
    14071397                $rewrite = array_merge($rewrite, array($pagematch => $pagequery));
    14081398
     
    14141404
    14151405            //do endpoints
    1416             if ($endpoints) {
     1406            if ( $endpoints ) {
    14171407                foreach ( (array) $ep_query_append as $regex => $ep) {
    14181408                    //add the endpoints on if the mask fits
    1419                     if ($ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) {
     1409                    if ( $ep[0] & $ep_mask || $ep[0] & $ep_mask_specific )
    14201410                        $rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2);
    1421                     }
    14221411                }
    14231412            }
    14241413
    14251414            //if we've got some tags in this dir
    1426             if ($num_toks) {
     1415            if ( $num_toks ) {
    14271416                $post = false;
    14281417                $page = false;
     
    14321421                //2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and
    14331422                //minute all present). Set these flags now as we need them for the endpoints.
    1434                 if (strpos($struct, '%postname%') !== false || strpos($struct, '%post_id%') !== false
     1423                if ( strpos($struct, '%postname%') !== false
     1424                        || strpos($struct, '%post_id%') !== false
    14351425                        || strpos($struct, '%pagename%') !== false
    1436                         || (strpos($struct, '%year%') !== false && strpos($struct, '%monthnum%') !== false && strpos($struct, '%day%') !== false && strpos($struct, '%hour%') !== false && strpos($struct, '%minute%') !== false && strpos($struct, '%second%') !== false)) {
     1426                        || (strpos($struct, '%year%') !== false && strpos($struct, '%monthnum%') !== false && strpos($struct, '%day%') !== false && strpos($struct, '%hour%') !== false && strpos($struct, '%minute%') !== false && strpos($struct, '%second%') !== false)
     1427                        ) {
    14371428                    $post = true;
    1438                     if (strpos($struct, '%pagename%') !== false)
     1429                    if ( strpos($struct, '%pagename%') !== false )
    14391430                        $page = true;
    14401431                }
     
    14461437                            $post = true;
    14471438                            $page = false;
     1439                            break;
    14481440                        }
    14491441                    }
     
    14511443
    14521444                //if we're creating rules for a permalink, do all the endpoints like attachments etc
    1453                 if ($post) {
    1454                     $post = true;
     1445                if ( $post ) {
    14551446                    //create query and regex for trackback
    14561447                    $trackbackmatch = $match . $trackbackregex;
     
    14591450                    $match = rtrim($match, '/');
    14601451                    //get rid of brackets
    1461                     $submatchbase = str_replace(array('(',')'),'',$match);
     1452                    $submatchbase = str_replace( array('(', ')'), '', $match);
    14621453
    14631454                    //add a rule for at attachments, which take the form of <permalink>/some-text
     
    14851476
    14861477                    //do endpoints for attachments
    1487                     if ( !empty($endpoints) ) { foreach ( (array) $ep_query_append as $regex => $ep ) {
    1488                         if ($ep[0] & EP_ATTACHMENT) {
    1489                             $rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
    1490                             $rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
     1478                    if ( !empty($endpoints) ) {
     1479                        foreach ( (array) $ep_query_append as $regex => $ep ) {
     1480                            if ( $ep[0] & EP_ATTACHMENT ) {
     1481                                $rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
     1482                                $rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
     1483                            }
    14911484                        }
    1492                     } }
     1485                    }
    14931486
    14941487                    //now we've finished with endpoints, finish off the $sub1 and $sub2 matches
     
    15111504
    15121505                //if we're matching a permalink, add those extras (attachments etc) on
    1513                 if ($post) {
     1506                if ( $post ) {
    15141507                    //add trackback
    15151508                    $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite);
     
    15671560        $rewrite = array();
    15681561
    1569         if (empty($this->permalink_structure)) {
     1562        if ( empty($this->permalink_structure) )
    15701563            return $rewrite;
    1571         }
    15721564
    15731565        // robots.txt
     
    15751567
    15761568        //Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category%
    1577         $default_feeds = array( '.*wp-atom.php$'    =>  $this->index .'?feed=atom',
    1578                                 '.*wp-rdf.php$' =>  $this->index .'?feed=rdf',
    1579                                 '.*wp-rss.php$' =>  $this->index .'?feed=rss',
    1580                                 '.*wp-rss2.php$'    =>  $this->index .'?feed=rss2',
    1581                                 '.*wp-feed.php$'    =>  $this->index .'?feed=feed',
     1569        $default_feeds = array( '.*wp-atom.php$'    =>  $this->index . '?feed=atom',
     1570                                '.*wp-rdf.php$'     =>  $this->index . '?feed=rdf',
     1571                                '.*wp-rss.php$'     =>  $this->index . '?feed=rss',
     1572                                '.*wp-rss2.php$'    =>  $this->index . '?feed=rss2',
     1573                                '.*wp-feed.php$'    =>  $this->index . '?feed=feed',
    15821574                                '.*wp-commentsrss2.php$'    =>  $this->index . '?feed=rss2&withcomments=1');
    15831575
     
    16751667     */
    16761668    function mod_rewrite_rules() {
    1677         if ( ! $this->using_permalinks()) {
     1669        if ( ! $this->using_permalinks() )
    16781670            return '';
    1679         }
    16801671
    16811672        $site_root = parse_url(get_option('siteurl'));
    1682         if ( isset( $site_root['path'] ) ) {
     1673        if ( isset( $site_root['path'] ) )
    16831674            $site_root = trailingslashit($site_root['path']);
    1684         }
    16851675
    16861676        $home_root = parse_url(home_url());
    1687         if ( isset( $home_root['path'] ) ) {
     1677        if ( isset( $home_root['path'] ) )
    16881678            $home_root = trailingslashit($home_root['path']);
    1689         } else {
     1679        else
    16901680            $home_root = '/';
    1691         }
    16921681
    16931682        $rules = "<IfModule mod_rewrite.c>\n";
     
    17031692            // If the match is unanchored and greedy, prepend rewrite conditions
    17041693            // to avoid infinite redirects and eclipsing of real files.
    1705             if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {
     1694            //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {
    17061695                //nada.
    1707             }
     1696            //}
    17081697
    17091698            $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
    17101699        }
    17111700
    1712         if ($this->use_verbose_rules) {
     1701        if ( $this->use_verbose_rules ) {
    17131702            $this->matches = '';
    17141703            $rewrite = $this->rewrite_rules();
     
    17241713                // If the match is unanchored and greedy, prepend rewrite conditions
    17251714                // to avoid infinite redirects and eclipsing of real files.
    1726                 if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {
     1715                //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {
    17271716                    //nada.
    1728                 }
    1729 
    1730                 if (strpos($query, $this->index) !== false) {
     1717                //}
     1718
     1719                if ( strpos($query, $this->index) !== false )
    17311720                    $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
    1732                 } else {
     1721                else
    17331722                    $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n";
    1734                 }
    17351723            }
    17361724        } else {
     
    17611749    function iis7_url_rewrite_rules($add_parent_tags = false, $indent = "  ", $end_of_line = "\n") {
    17621750
    1763         if ( ! $this->using_permalinks()) {
     1751        if ( ! $this->using_permalinks() )
    17641752            return '';
    1765         }
    17661753
    17671754        if ( !is_multisite() ) {
     
    17941781            $siteurl = get_option( 'siteurl' );
    17951782            $siteurl_len = strlen( $siteurl );
    1796             if ( defined( 'WP_CONTENT_URL' ) && substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len )
     1783            if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len )
    17971784                $content_path = substr( WP_CONTENT_URL, $siteurl_len + 1 );
    17981785            else
     
    18641851        $index = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?'));
    18651852        $front = substr($redirect, 0, $index);
    1866         if ($front != $this->index) { //it doesn't redirect to WP's index.php
     1853        if ( $front != $this->index ) { //it doesn't redirect to WP's index.php
    18671854            $this->add_external_rule($regex, $redirect);
    18681855        } else {
     
    19611948        $this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%'));
    19621949        $this->root = '';
    1963         if ($this->using_index_permalinks()) {
     1950        if ( $this->using_index_permalinks() )
    19641951            $this->root = $this->index . '/';
    1965         }
    19661952        $this->category_base = get_option( 'category_base' );
    19671953        $this->tag_base = get_option( 'tag_base' );
     
    19981984     */
    19991985    function set_permalink_structure($permalink_structure) {
    2000         if ($permalink_structure != $this->permalink_structure) {
     1986        if ( $permalink_structure != $this->permalink_structure ) {
    20011987            update_option('permalink_structure', $permalink_structure);
    20021988            $this->init();
     
    20182004     */
    20192005    function set_category_base($category_base) {
    2020         if ($category_base != $this->category_base) {
     2006        if ( $category_base != $this->category_base ) {
    20212007            update_option('category_base', $category_base);
    20222008            $this->init();
Note: See TracChangeset for help on using the changeset viewer.