summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-06 18:36:35 +0000
committerAndres Rey <[email protected]>2017-11-06 18:36:35 +0000
commit857736c6e90fbe2da8cb870855e84f04e8e67aee (patch)
tree0412cf3d52d6cf2d0f5b6bf13340d07aeb7e35bf /src
parent056921e2450de888a18313610a5303e3edbb2ed4 (diff)
Check for maxDepth before continuing
Diffstat (limited to 'src')
-rw-r--r--src/Readability.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Readability.php b/src/Readability.php
index 5e0d4b4..b0a5830 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -472,7 +472,7 @@ class Readability extends Element implements ReadabilityInterface
{
$depth = 0;
while ($node->getParent()) {
- if ($depth > $maxDepth) {
+ if ($maxDepth > 0 && $depth > $maxDepth) {
return false;
}
if ($node->getParent()->tagNameEqualsTo($tagName)) {