Make WordPress Core

Ticket #3920: 3920.2.diff

File 3920.2.diff, 27.0 KB (added by rob1n, 18 years ago)

Fix typo noticed by MarkJaquith.

  • app.php

     
    192192                                $this->in_content = array();
    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 {
    198198                                        array_push($this->in_content, "</$endtag>");
     
    220220                #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n";
    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                        }
    226226                        array_push($this->in_content, $this->xml_escape($data));
  • wp-admin/admin-functions.php

     
    11431143                if ( $markerdata ) {
    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 ) {
    11491149                                        if ( $n + 1 < count( $markerdata ) )
     
    11511151                                        else
    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 ))
    11571157                                                foreach ( $insertion as $insertline )
     
    11891189        {
    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                }
    11991199        }
     
    17581758                <p id="bh" style="text-align: center;"><a href="http://browsehappy.com/" title="'.$getit.'"><img src="images/browse-happy.gif" alt="Browse Happy" /></a></p>
    17591759                ';
    17601760}
    1761 if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ))
     1761
     1762if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
    17621763        add_action( 'admin_footer', 'browse_happy' );
    17631764
    17641765function documentation_link( $for ) {
     
    19191920function wp_import_upload_form( $action ) {
    19201921        $size = strtolower( ini_get( 'upload_max_filesize' ) );
    19211922        $bytes = 0;
    1922         if ( strstr( $size, 'k' ) )
     1923        if (strpos($size, 'k') !== false)
    19231924                $bytes = $size * 1024;
    1924         if ( strstr( $size, 'm' ) )
     1925        if (strpos($size, 'm') !== false)
    19251926                $bytes = $size * 1024 * 1024;
    1926         if ( strstr( $size, 'g' ) )
     1927        if (strpos($size, 'g') !== false)
    19271928                $bytes = $size * 1024 * 1024 * 1024;
    19281929?>
    19291930<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo $action ?>">
  • wp-admin/edit-link-form.php

     
    2222        }
    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        }
    3030}
  • wp-admin/import/blogger.php

     
    941941                                $this->in_content = array();
    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 {
    947947                                        array_push($this->in_content, "</$endtag>");
     
    969969                #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n";
    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                        }
    975975                        array_push($this->in_content, $this->xml_escape($data));
  • wp-admin/menu.php

     
    66// The URL of the item's file
    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
    1616        $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php');
  • wp-admin/options.php

     
    148148        <th scope='row'><label for='$option->option_name'>$option->option_name</label></th>
    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
    154154        echo "</td>
  • wp-admin/page.php

     
    148148        }
    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);
    155155        exit();
  • wp-admin/post.php

     
    160160        }
    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);
    167167        exit();
  • wp-admin/templates.php

     
    5252        if ( ! current_user_can('edit_files') )
    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
    5858        update_recently_edited($file);
  • wp-admin/upgrade-functions.php

     
    922922
    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;
    928928                                continue; // Don't copy anything
     
    994994                $f = fopen("$site_dir/style.css", 'w');
    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);
    10051005        }
  • wp-blog-header.php

     
    22
    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
    88        require_once( dirname(__FILE__) . '/wp-includes/classes.php');
  • wp-content/themes/default/functions.php

     
    2525}
    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'];
    3131        } else
     
    3333}
    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'];
    3939        } else
  • wp-includes/classes.php

     
    120120                        }
    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']);
    126126
    127127                                if (isset($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
    133133                                $this->did_permalink = false;
  • wp-includes/comment-template.php

     
    239239
    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}
    257257
  • wp-includes/feed.php

     
    165165
    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
    171171                $type = 'html';
  • wp-includes/formatting.php

     
    2929                if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag
    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 {
    3837                        $next = true;
     
    7877        }
    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 );
    8483
     
    658657
    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;
    664663                } else {
     
    10721071        $strip = array('%0d', '%0a');
    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) )
    10781077                $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
  • wp-includes/functions.php

     
    780780                $protocol = '';
    781781        }
    782782
    783         if ( strstr($uri, '?') ) {
     783        if (strpos($uri, '?') !== false) {
    784784                $parts = explode('?', $uri, 2);
    785785                if ( 1 == count($parts) ) {
    786786                        $base = '?';
     
    789789                        $base = $parts[0] . '?';
    790790                        $query = $parts[1];
    791791                }
    792         } else if ( !empty($protocol) || strstr($uri, '/') ) {
     792        } elseif (!empty($protocol) || strpos($uri, '/') !== false) {
    793793                $base = $uri . '?';
    794794                $query = '';
    795795        } else {
     
    13371337        if ( empty($title) )
    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
    13431343                $admin_dir = 'wp-admin/';
  • wp-includes/general-template.php

     
    554554                $daywithpost = array();
    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
    562560                $ak_title_separator = ', ';
  • wp-includes/link-template.php

     
    7070                $unixtime = strtotime($post->post_date);
    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;
    7676                        if ( $parent=$cats[0]->category_parent )
     
    158158                        $parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front
    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        }
    164164
  • wp-includes/pluggable.php

     
    280280        $adminurl = strtolower(get_option('siteurl')).'/wp-admin';
    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();
    286286        }
  • wp-includes/post.php

     
    11981198//
    11991199
    12001200function is_local_attachment($url) {
    1201         if ( !strstr($url, get_bloginfo('url') ) )
     1201        if (strpos($url, get_bloginfo('url')) === false)
    12021202                return false;
    1203         if ( strstr($url, get_bloginfo('url') . '/?attachment_id=') )
     1203        if (strpos($url, get_bloginfo('url') . '/?attachment_id=') !== false)
    12041204                return true;
    12051205        if ( $id = url_to_postid($url) ) {
    12061206                $post = & get_post($id);
  • wp-includes/query.php

     
    2929function is_admin () {
    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
    3535function is_archive () {
     
    510510                        if (empty($qv['cat']) || ($qv['cat'] == '0')) {
    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 {
    516516                                        $this->is_category = true;
     
    557557                        $this->is_preview = true;
    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                }
    563563
     
    850850                        $in_cats = $out_cats = $out_posts = '';
    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 )
    856856                                        $in_cats .= "$cat, " . get_category_children($cat, '', ', ');
     
    918918                } else {
    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';
    924924                                $q['author'] = explode('-', $q['author']);
     
    938938                // Author stuff for nice URLs
    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]) {
    944944                                        $q['author_name'] = $q['author_name'][count($q['author_name'])-1];#no trailing slash
  • wp-includes/rewrite.php

     
    591591                                //individual post. Do this by checking it contains at least one of 1) post name,
    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                                }
    601601
     
    809809                                        //nada.
    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 {
    815815                                        $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n";
  • wp-includes/vars.php

     
    3232$is_IE = ( $is_macIE || $is_winIE );
    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
    3939if (!isset($wpsmiliestrans)) {
  • wp-includes/wp-db.php

     
    372372
    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
    378378                        $admin_dir = 'wp-admin/';
  • wp-settings.php

     
    4040        $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
    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
    4646// Fix empty PHP_SELF
     
    140140include_once(ABSPATH . WPINC . '/gettext.php');
    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
    147147                $link = 'wp-admin/install.php';
     
    172172require (ABSPATH . WPINC . '/deprecated.php');
    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') )
    182182        define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH);