summaryrefslogtreecommitdiff
path: root/src/Readability.php
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2016-11-11 16:03:43 +0000
committerAndres Rey <[email protected]>2016-11-11 16:03:43 +0000
commit0fd5f344ab0383316f03826d5dcb4909864854cb (patch)
treec1c15ef60ac054af277d22648d66204ddebb329e /src/Readability.php
parentd34f8c03fd869815044b5769973e8c6ff336de2a (diff)
Removed more JS translation errors, fixed body importing when no top candidate is found
Diffstat (limited to 'src/Readability.php')
-rw-r--r--src/Readability.php7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Readability.php b/src/Readability.php
index 5a1a6e9..adda48a 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -49,12 +49,7 @@ class Readability extends Element implements ReadabilityInterface
$score = 0;
if (!in_array(get_class($node), ['DOMDocument', 'DOMComment'])) {
- try {
$score = $node->getAttribute('readability');
-
- } catch (\Error $e) {
- $test=1;
- }
}
$this->setContentScore(($score) ? $score : 0);
@@ -114,7 +109,7 @@ class Readability extends Element implements ReadabilityInterface
$node = $this;
- while ($node && $node->getParent()) {
+ while (($node) ? $node->getParent() : $node) {
$ancestors[] = new static($node->node);
$level++;
if ($level >= $maxLevel) {