Make WordPress Core


Ignore:
Timestamp:
03/07/2007 05:29:15 AM (19 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/functions.php

    r4961 r4990  
    781781        }
    782782
    783         if ( strstr($uri, '?') ) {
     783        if (strpos($uri, '?') !== false) {
    784784                $parts = explode('?', $uri, 2);
    785785                if ( 1 == count($parts) ) {
     
    790790                        $query = $parts[1];
    791791                }
    792         } else if ( !empty($protocol) || strstr($uri, '/') ) {
     792        } elseif (!empty($protocol) || strpos($uri, '/') !== false) {
    793793                $base = $uri . '?';
    794794                $query = '';
     
    13381338                $title = __('WordPress › Error');
    13391339
    1340         if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
     1340        if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)
    13411341                $admin_dir = '';
    13421342        else
Note: See TracChangeset for help on using the changeset viewer.