aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggAutoP.php
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-02-04 20:51:07 -0500
committerCash Costello <cash.costello@gmail.com>2013-02-09 07:53:45 -0500
commit707df9db27cf2154910978427b9844448bcf931a (patch)
tree6ca8ba536758fe2f34ac6a55a18b7befa76bc74c /engine/classes/ElggAutoP.php
parent85e4c16f39a8b00b229644bcd175663541dfd51a (diff)
downloadelgg-707df9db27cf2154910978427b9844448bcf931a.tar.gz
elgg-707df9db27cf2154910978427b9844448bcf931a.tar.bz2
Small changes to remove static analysis noise and simplify flow
Diffstat (limited to 'engine/classes/ElggAutoP.php')
-rw-r--r--engine/classes/ElggAutoP.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/engine/classes/ElggAutoP.php b/engine/classes/ElggAutoP.php
index 40600aa13..f3c7cc972 100644
--- a/engine/classes/ElggAutoP.php
+++ b/engine/classes/ElggAutoP.php
@@ -159,8 +159,9 @@ class ElggAutoP {
/* @var DOMElement $el */
$autops = $this->_xpath->query('./autop', $el);
if ($autops->length === 1) {
- // strip w/ preg_replace later (faster than moving nodes out)
- $autops->item(0)->setAttribute("r", "1");
+ $firstAutop = $autops->item(0);
+ /* @var DOMElement $firstAutop */
+ $firstAutop->setAttribute("r", "1");
}
}
@@ -220,12 +221,12 @@ class ElggAutoP {
$isElement = ($node->nodeType === XML_ELEMENT_NODE);
if ($isElement) {
- $elName = $node->nodeName;
+ $isBlock = in_array($node->nodeName, $this->_blocks);
+ } else {
+ $isBlock = false;
}
- $isBlock = ($isElement && in_array($elName, $this->_blocks));
if ($alterInline) {
- $isInline = $isElement && ! $isBlock;
$isText = ($node->nodeType === XML_TEXT_NODE);
$isLastInline = (! $node->nextSibling
|| ($node->nextSibling->nodeType === XML_ELEMENT_NODE