WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/07/2007 05:29:15 AM (14 years ago)
Author:
markjaquith
Message:

Use strpos instead of strstr where ever possible, for speed. Props rob1n. fixes #3920

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r4983 r4990  
    7171
    7272        $category = '';
    73         if ( strstr($permalink, '%category%') ) {
     73        if (strpos($permalink, '%category%') !== false) {
    7474            $cats = get_the_category($post->ID);
    7575            $category = $cats[0]->category_nicename;
     
    159159        else
    160160            $parentlink = get_permalink( $object->post_parent );
    161         if (! strstr($parentlink, '?') )
     161        if (strpos($parentlink, '?') === false)
    162162            $link = trim($parentlink, '/') . '/' . $object->post_name . '/';
    163163    }
Note: See TracChangeset for help on using the changeset viewer.