Make WordPress Core

Changeset 4990 for trunk/app.php


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/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                        }
Note: See TracChangeset for help on using the changeset viewer.