Use strpos instead of strstr where ever possible, for speed. Props rob1n. fixes #3920
git-svn-id: http://svn.automattic.com/wordpress/trunk@4990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -941,7 +941,7 @@ class AtomParser {
|
||||
$this->in_content = array();
|
||||
} else {
|
||||
$endtag = $this->ns_to_prefix($name);
|
||||
if(strstr($this->in_content[count($this->in_content)-1], "<$endtag")) {
|
||||
if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) {
|
||||
array_push($this->in_content, "/>");
|
||||
} else {
|
||||
array_push($this->in_content, "</$endtag>");
|
||||
@@ -969,7 +969,7 @@ class AtomParser {
|
||||
#print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n";
|
||||
if(!empty($this->in_content)) {
|
||||
// handle self-closing tags (case: text node found, need to close element started)
|
||||
if(strstr($this->in_content[count($this->in_content)-1], "<")) {
|
||||
if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) {
|
||||
array_push($this->in_content, ">");
|
||||
}
|
||||
array_push($this->in_content, $this->xml_escape($data));
|
||||
|
||||
Reference in New Issue
Block a user