diff options
author | Andres Rey <[email protected]> | 2017-11-06 18:36:35 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-11-06 18:36:35 +0000 |
commit | 857736c6e90fbe2da8cb870855e84f04e8e67aee (patch) | |
tree | 0412cf3d52d6cf2d0f5b6bf13340d07aeb7e35bf | |
parent | 056921e2450de888a18313610a5303e3edbb2ed4 (diff) |
Check for maxDepth before continuing
-rw-r--r-- | src/Readability.php | 2 |
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)) { |