summaryrefslogtreecommitdiff
path: root/src/Readability.php
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2019-07-15 23:03:38 +0100
committerAndres Rey <[email protected]>2019-07-15 23:03:38 +0100
commit209919fbbb31c97b09c4d2b04e7b3b2204b3d3a6 (patch)
treeda33bb94054ea3ede86dfd0b970e840932a09d49 /src/Readability.php
parentdb65ea7804d655ffc7a3cc478152cce70777ed4c (diff)
Fix wrong access to first element child
Diffstat (limited to 'src/Readability.php')
-rw-r--r--src/Readability.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Readability.php b/src/Readability.php
index 921101f..6bcbf78 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -1280,7 +1280,7 @@ class Readability
// Remove single-cell tables
foreach ($article->shiftingAwareGetElementsByTagName('table') as $table) {
/** @var DOMNode $table */
- $tbody = $table->hasSingleTagInsideElement('tbody') ? $table->childNodes[0] : $table;
+ $tbody = $table->hasSingleTagInsideElement('tbody') ? $table->getFirstElementChild() : $table;
if ($tbody->hasSingleTagInsideElement('tr')) {
$row = $tbody->getFirstElementChild();
if ($row->hasSingleTagInsideElement('td')) {