WordPress.org

Make WordPress Core

Changeset 4990 for trunk/wp-settings.php


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-settings.php

    r4972 r4990  
    4141
    4242// Fix for Dreamhost and other PHP as CGI hosts
    43 if ( strstr( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) )
     43if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false)
    4444    unset($_SERVER['PATH_INFO']);
    4545
     
    141141require_once (ABSPATH . WPINC . '/l10n.php');
    142142
    143 if ( !is_blog_installed() && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) {
    144     if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
     143if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) {
     144    if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)
    145145        $link = 'install.php';
    146146    else
     
    173173require (ABSPATH . WPINC . '/script-loader.php');
    174174
    175 if (!strstr($_SERVER['PHP_SELF'], 'install.php')) :
     175if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) {
    176176    // Used to guarantee unique hash cookies
    177177    $cookiehash = md5(get_option('siteurl'));
    178178    define('COOKIEHASH', $cookiehash);
    179 endif;
     179}
    180180
    181181if ( !defined('USER_COOKIE') )
Note: See TracChangeset for help on using the changeset viewer.