summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-11 20:12:05 +0000
committerAndres Rey <[email protected]>2017-11-11 20:12:05 +0000
commit24aeb34aa6724675e3a501d29258f20ea2d18d67 (patch)
tree25216b0a2f1bcfcb4fde55cdd0e10fb6c90e0504
parent0e9d83dfea6982426f73b15a5f1d943164cf409d (diff)
Switch to array iterator when replacing links on prepArticle
-rw-r--r--src/HTMLParser.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php
index 5d1aa48..b896ef7 100644
--- a/src/HTMLParser.php
+++ b/src/HTMLParser.php
@@ -341,7 +341,7 @@ class HTMLParser
// Readability cannot open relative uris so we convert them to absolute uris.
if ($this->getConfig()->getOption('fixRelativeURLs')) {
- foreach ($article->getElementsByTagName('a') as $link) {
+ foreach (iterator_to_array($article->getElementsByTagName('a')) as $link) {
/** @var \DOMElement $link */
$href = $link->getAttribute('href');
if ($href) {