WordPress.org

Make WordPress Core

Changeset 4990


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

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

Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/app.php

    r4953 r4990  
    193193            } else { 
    194194                $endtag = $this->ns_to_prefix($name); 
    195                 if(strstr($this->in_content[count($this->in_content)-1], "<$endtag")) { 
     195                if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) 
    196196                    array_push($this->in_content, "/>"); 
    197197                } else { 
     
    221221        if(!empty($this->in_content)) { 
    222222            // handle self-closing tags (case: text node found, need to close element started) 
    223             if(strstr($this->in_content[count($this->in_content)-1], "<")) { 
     223            if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { 
    224224                array_push($this->in_content, ">"); 
    225225            } 
  • trunk/wp-admin/admin-functions.php

    r4987 r4990  
    11441144            $state = true; 
    11451145            foreach ( $markerdata as $n => $markerline ) { 
    1146                 if ( strstr( $markerline, "# BEGIN {$marker}" )) 
     1146                if (strpos($markerline, '# BEGIN ' . $marker) !== false) 
    11471147                    $state = false; 
    11481148                if ( $state ) { 
     
    11521152                        fwrite( $f, "{$markerline}" ); 
    11531153                } 
    1154                 if ( strstr( $markerline, "# END {$marker}" ) ) { 
     1154                if (strpos($markerline, '# END ' . $marker) !== false) { 
    11551155                    fwrite( $f, "# BEGIN {$marker}\n" ); 
    11561156                    if ( is_array( $insertion )) 
     
    11901190        $state = false; 
    11911191        foreach ( $markerdata as $markerline ) { 
    1192             if ( strstr( $markerline, "# END {$marker}" )) 
     1192            if (strpos($markerline, '# END ' . $marker) !== false) 
    11931193                $state = false; 
    11941194            if ( $state ) 
    11951195                $result[] = $markerline; 
    1196             if ( strstr( $markerline, "# BEGIN {$marker}" )) 
     1196            if (strpos($markerline, '# BEGIN ' . $marker) !== false) 
    11971197                $state = true; 
    11981198        } 
     
    17671767        '; 
    17681768} 
    1769 if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'MSIE' )) 
     1769 
     1770if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) 
    17701771    add_action( 'admin_footer', 'browse_happy' ); 
    17711772 
     
    19281929    $size = strtolower( ini_get( 'upload_max_filesize' ) ); 
    19291930    $bytes = 0; 
    1930     if ( strstr( $size, 'k' ) ) 
     1931    if (strpos($size, 'k') !== false) 
    19311932        $bytes = $size * 1024; 
    1932     if ( strstr( $size, 'm' ) ) 
     1933    if (strpos($size, 'm') !== false) 
    19331934        $bytes = $size * 1024 * 1024; 
    1934     if ( strstr( $size, 'g' ) ) 
     1935    if (strpos($size, 'g') !== false) 
    19351936        $bytes = $size * 1024 * 1024 * 1024; 
    19361937?> 
  • trunk/wp-admin/edit-link-form.php

    r4656 r4990  
    2323 
    2424    if ('' == $value) { 
    25         if ('family' == $class && !strstr($link_rel, 'child') && !strstr($link_rel, 'parent') && !strstr($link_rel, 'sibling') && !strstr($link_rel, 'spouse') && !strstr($link_rel, 'kin')) echo ' checked="checked"'; 
    26         if ('friendship' == $class && !strstr($link_rel, 'friend') && !strstr($link_rel, 'acquaintance') && !strstr($link_rel, 'contact') ) echo ' checked="checked"'; 
    27         if ('geographical' == $class && !strstr($link_rel, 'co-resident') && !strstr($link_rel, 'neighbor') ) echo ' checked="checked"'; 
     25        if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"'; 
     26        if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"'; 
     27        if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"'; 
    2828        if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"'; 
    2929    } 
  • trunk/wp-admin/import/blogger.php

    r4953 r4990  
    942942            } else { 
    943943                $endtag = $this->ns_to_prefix($name); 
    944                 if(strstr($this->in_content[count($this->in_content)-1], "<$endtag")) { 
     944                if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) { 
    945945                    array_push($this->in_content, "/>"); 
    946946                } else { 
     
    970970        if(!empty($this->in_content)) { 
    971971            // handle self-closing tags (case: text node found, need to close element started) 
    972             if(strstr($this->in_content[count($this->in_content)-1], "<")) { 
     972            if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { 
    973973                array_push($this->in_content, ">"); 
    974974            } 
  • trunk/wp-admin/menu.php

    r4953 r4990  
    77$menu[0] = array(__('Dashboard'), 'read', 'index.php'); 
    88 
    9 if ( strstr($_SERVER['REQUEST_URI'], 'edit-pages.php') ) 
     9if (strpos($_SERVER['REQUEST_URI'], 'edit-pages.php') !== false) 
    1010    $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php'); 
    1111else 
    1212    $menu[5] = array(__('Write'), 'edit_posts', 'post-new.php'); 
    13 if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') ) 
     13if (strpos($_SERVER['REQUEST_URI'], 'page-new.php') !== false) 
    1414    $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php'); 
    1515else 
  • trunk/wp-admin/options.php

    r4953 r4990  
    149149<td>"; 
    150150 
    151     if (stristr($value, "\n")) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>"; 
     151    if (strpos($value, "\n") !== false) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>"; 
    152152    else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "'$disabled />"; 
    153153 
  • trunk/wp-admin/page.php

    r4953 r4990  
    149149 
    150150    $sendback = wp_get_referer(); 
    151     if (strstr($sendback, 'page.php')) $sendback = get_option('siteurl') .'/wp-admin/page.php'; 
    152     elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; 
     151    if (strpos($sendback, 'page.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/page.php'; 
     152    elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; 
    153153    $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); 
    154154    wp_redirect($sendback); 
  • trunk/wp-admin/post.php

    r4953 r4990  
    161161 
    162162    $sendback = wp_get_referer(); 
    163     if (strstr($sendback, 'post.php')) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; 
    164     elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; 
     163    if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; 
     164    elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; 
    165165    $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); 
    166166    wp_redirect($sendback); 
  • trunk/wp-admin/templates.php

    r4666 r4990  
    5353        wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
    5454 
    55     if ( strstr( $file, 'wp-config.php' ) ) 
     55    if (strpos($file, 'wp-config.php') !== false) 
    5656    wp_die('<p>'.__('The config file cannot be edited or viewed through the web interface. Sorry!').'</p>'); 
    5757 
  • trunk/wp-admin/upgrade-functions.php

    r4772 r4990  
    923923        if ($oldfile == 'index.php') { // Check to make sure it's not a new index 
    924924            $index = implode('', file("$oldpath/$oldfile")); 
    925             if ( strstr( $index, 'WP_USE_THEMES' ) ) { 
     925            if (strpos($index, 'WP_USE_THEMES') !== false) { 
    926926                if (! @copy(ABSPATH . 'wp-content/themes/default/index.php', "$site_dir/$newfile")) 
    927927                    return false; 
     
    995995 
    996996        foreach ($stylelines as $line) { 
    997             if (strstr($line, "Theme Name:")) $line = "Theme Name: $theme_name"; 
    998             elseif (strstr($line, "Theme URI:")) $line = "Theme URI: " . __get_option('siteurl'); 
    999             elseif (strstr($line, "Description:")) $line = "Description: Your theme"; 
    1000             elseif (strstr($line, "Version:")) $line = "Version: 1"; 
    1001             elseif (strstr($line, "Author:")) $line = "Author: You"; 
    1002             fwrite($f, "{$line}\n"); 
     997            if (strpos($line, 'Theme Name:') !== false) $line = 'Theme Name: ' . $theme_name; 
     998            elseif (strpos($line, 'Theme URI:') !== false) $line = 'Theme URI: ' . __get_option('url'); 
     999            elseif (strpos($line, 'Description:') !== false) $line = 'Description: Your theme.'; 
     1000            elseif (strpos($line, 'Version:') !== false) $line = 'Version: 1'; 
     1001            elseif (strpos($line, 'Author:') !== false) $line = 'Author: You'; 
     1002            fwrite($f, $line . "\n"); 
    10031003        } 
    10041004        fclose($f); 
  • trunk/wp-blog-header.php

    r4973 r4990  
    33if (! isset($wp_did_header)): 
    44if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) { 
    5     if ( strstr( $_SERVER['PHP_SELF'], 'wp-admin') ) $path = ''; 
     5    if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = ''; 
    66    else $path = 'wp-admin/'; 
    77 
  • trunk/wp-content/themes/default/functions.php

    r4747 r4990  
    2626 
    2727function kubrick_upper_color() { 
    28     if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { 
     28    if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { 
    2929        parse_str(substr($url, strpos($url, '?') + 1), $q); 
    3030        return $q['upper']; 
     
    3434 
    3535function kubrick_lower_color() { 
    36     if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { 
     36    if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { 
    3737        parse_str(substr($url, strpos($url, '?') + 1), $q); 
    3838        return $q['lower']; 
  • trunk/wp-includes/classes.php

    r4979 r4990  
    121121 
    122122            // If req_uri is empty or if it is a request for ourself, unset error. 
    123             if ( empty($request) || $req_uri == $self || strstr($_SERVER['PHP_SELF'], 'wp-admin/') ) { 
     123            if (empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) { 
    124124                if (isset($_GET['error'])) 
    125125                    unset($_GET['error']); 
     
    128128                    unset($error); 
    129129 
    130                 if ( isset($perma_query_vars) && strstr($_SERVER['PHP_SELF'], 'wp-admin/') ) 
     130                if (isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) 
    131131                    unset($perma_query_vars); 
    132132 
  • trunk/wp-includes/comment-template.php

    r4934 r4990  
    240240function trackback_rdf($timezone = 0) { 
    241241    global $id; 
    242     if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) { 
    243     echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
    244             xmlns:dc="http://purl.org/dc/elements/1.1/" 
    245             xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> 
    246         <rdf:Description rdf:about="'; 
    247     the_permalink(); 
    248     echo '"'."\n"; 
    249     echo '    dc:identifier="'; 
    250     the_permalink(); 
    251     echo '"'."\n"; 
    252     echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n"; 
    253     echo '    trackback:ping="'.trackback_url(0).'"'." />\n"; 
    254     echo '</rdf:RDF>'; 
     242    if (strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) { 
     243        echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
     244                xmlns:dc="http://purl.org/dc/elements/1.1/" 
     245                xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> 
     246            <rdf:Description rdf:about="'; 
     247        the_permalink(); 
     248        echo '"'."\n"; 
     249        echo '    dc:identifier="'; 
     250        the_permalink(); 
     251        echo '"'."\n"; 
     252        echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n"; 
     253        echo '    trackback:ping="'.trackback_url(0).'"'." />\n"; 
     254        echo '</rdf:RDF>'; 
    255255    } 
    256256} 
  • trunk/wp-includes/feed.php

    r4937 r4990  
    166166function html_type_rss() { 
    167167    $type = get_bloginfo('html_type'); 
    168     if ( strstr( $type, 'xhtml' ) ) 
     168    if (strpos($type, 'xhtml') !== false) 
    169169        $type = 'xhtml'; 
    170170    else 
  • trunk/wp-includes/formatting.php

    r4953 r4990  
    3030            // static strings 
    3131            $curl = str_replace($static_characters, $static_replacements, $curl); 
    32  
    3332            // regular expressions 
    3433            $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); 
    35         } elseif ( strstr($curl, '<code') || strstr($curl, '<pre') || strstr($curl, '<kbd') || strstr($curl, '<style') || strstr($curl, '<script') ) {  
     34        } elseif (strpos($curl, '<code') !== false || strpos($curl, '<pre') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) { 
    3635            $next = false; 
    3736        } else { 
     
    7978    $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee); 
    8079    $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee); 
    81     if ( strstr( $pee, '<pre' ) ) 
     80    if (strpos($pee, '<pre') !== false) 
    8281        $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') .  stripslashes(clean_pre('$2'))  . '</pre>' ", $pee); 
    8382    $pee = preg_replace( "|\n</p>$|", '</p>', $pee ); 
     
    659658function is_email($user_email) { 
    660659    $chars = "/^([a-z0-9+_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,6}\$/i"; 
    661     if(strstr($user_email, '@') && strstr($user_email, '.')) { 
     660    if (strpos($user_email, '@') !== false && strpos($user_email, '.') !== false) { 
    662661        if (preg_match($chars, $user_email)) { 
    663662            return true; 
     
    10731072    $url = str_replace($strip, '', $url); 
    10741073    $url = str_replace(';//', '://', $url); 
    1075     $url = (!strstr($url, '://')) ? 'http://'.$url : $url; 
     1074    $url = (strpos($url, '://') === false) ? 'http://'.$url : $url; 
    10761075    $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url); 
    10771076    if ( !is_array($protocols) ) 
  • 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 &rsaquo; Error'); 
    13391339 
    1340     if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) 
     1340    if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) 
    13411341        $admin_dir = ''; 
    13421342    else 
  • trunk/wp-includes/general-template.php

    r4983 r4990  
    555555    } 
    556556 
    557  
    558  
    559     if ( strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') ) 
     557    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false) 
    560558        $ak_title_separator = "\n"; 
    561559    else 
  • 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    } 
  • trunk/wp-includes/pluggable.php

    r4953 r4990  
    281281    $referer = strtolower(wp_get_referer()); 
    282282    if ( !wp_verify_nonce($_REQUEST['_wpnonce'], $action) && 
    283         !(-1 == $action && strstr($referer, $adminurl)) ) { 
     283        !(-1 == $action && strpos($referer, $adminurl) !== false)) 
    284284        wp_nonce_ays($action); 
    285285        die(); 
  • trunk/wp-includes/post.php

    r4983 r4990  
    11991199 
    12001200function is_local_attachment($url) { 
    1201     if ( !strstr($url, get_bloginfo('url') ) ) 
    1202         return false; 
    1203     if ( strstr($url, get_bloginfo('url') . '/?attachment_id=') ) 
     1201    if (strpos($url, get_bloginfo('url')) === false) 
     1202        return false; 
     1203    if (strpos($url, get_bloginfo('url') . '/?attachment_id=') !== false) 
    12041204        return true; 
    12051205    if ( $id = url_to_postid($url) ) { 
  • trunk/wp-includes/query.php

    r4956 r4990  
    3030    global $wp_query; 
    3131 
    32     return ( $wp_query->is_admin || strstr($_SERVER['REQUEST_URI'], 'wp-admin/') ); 
     32    return ($wp_query->is_admin || (strpos($_SERVER['REQUEST_URI'], 'wp-admin/') !== false)); 
    3333} 
    3434 
     
    511511                $this->is_category = false; 
    512512            } else { 
    513                 if (stristr($qv['cat'],'-')) { 
     513                if (strpos($qv['cat'], '-') !== false) { 
    514514                    $this->is_category = false; 
    515515                } else { 
     
    558558        } 
    559559 
    560         if (strstr($_SERVER['PHP_SELF'], 'wp-admin/')) { 
     560        if (strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) { 
    561561            $this->is_admin = true; 
    562562        } 
     
    851851            foreach ( $cat_array as $cat ) { 
    852852                $cat = intval($cat); 
    853                 $in = strstr($cat, '-') ? false : true; 
     853                $in = (strpos($cat, '-') !== false) ? false : true; 
    854854                $cat = trim($cat, '-'); 
    855855                if ( $in ) 
     
    919919            $q['author'] = ''.urldecode($q['author']).''; 
    920920            $q['author'] = addslashes_gpc($q['author']); 
    921             if (stristr($q['author'], '-')) { 
     921            if (strpos($q['author'], '-') !== false) { 
    922922                $eq = '!='; 
    923923                $andor = 'AND'; 
     
    939939 
    940940        if ('' != $q['author_name']) { 
    941             if (stristr($q['author_name'],'/')) { 
     941            if (strpos($q['author_name'], '/') !== false) { 
    942942                $q['author_name'] = explode('/',$q['author_name']); 
    943943                if ($q['author_name'][count($q['author_name'])-1]) { 
  • trunk/wp-includes/rewrite.php

    r4886 r4990  
    592592                //2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and 
    593593                //minute all present). Set these flags now as we need them for the endpoints. 
    594                 if (strstr($struct, '%postname%') || strstr($struct, '%post_id%') 
    595                         || strstr($struct, '%pagename%') 
    596                         || (strstr($struct, '%year%') &&  strstr($struct, '%monthnum%') && strstr($struct, '%day%') && strstr($struct, '%hour%') && strstr($struct, '%minute') && strstr($struct, '%second%'))) { 
     594                if (strpos($struct, '%postname%') !== false || strpos($struct, '%post_id%') !== false 
     595                        || strpos($struct, '%pagename%') !== false 
     596                        || (strpos($struct, '%year%') !== false && strpos($struct, '%monthnum%') !== false && strpos($struct, '%day%') !== false && strpos($struct, '%hour%') !== false && strpos($struct, '%minute%') !== false && strpos($struct, '%second%') !== false)) { 
    597597                    $post = true; 
    598                     if  ( strstr($struct, '%pagename%') ) 
     598                    if (strpos($struct, '%pagename%') !== false) 
    599599                        $page = true; 
    600600                } 
     
    810810                } 
    811811 
    812                 if (strstr($query, $this->index)) { 
     812                if (strpos($query, $this->index) !== false) { 
    813813                    $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; 
    814814                } else { 
  • trunk/wp-includes/vars.php

    r4626 r4990  
    3333 
    3434// Server detection 
    35 $is_apache = ( strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') || strstr($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') ) ? 1 : 0; 
    36 $is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0; 
     35$is_apache ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? 1 : 0; 
     36$is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? 1 : 0; 
    3737 
    3838// if the config file does not provide the smilies array, let's define it here 
  • trunk/wp-includes/wp-db.php

    r4953 r4990  
    373373        header('Content-Type: text/html; charset=utf-8'); 
    374374 
    375         if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) 
     375        if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) 
    376376            $admin_dir = ''; 
    377377        else 
  • 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.