diff options
author | 2019-06-02 13:03:26 +0200 | |
---|---|---|
committer | 2019-06-02 13:06:16 +0200 | |
commit | 6c4098d6558c33a5fcb2a8bc9fb29e915d56fc6c (patch) | |
tree | 433e33c7cab8b7aac2342c7d8c8e8ddf325463c5 /bridges/RadioMelodieBridge.php | |
parent | 468d8be72d34f0a94e5ae4090b3321c5bda4db35 (diff) | |
download | rss-bridge-6c4098d6558c33a5fcb2a8bc9fb29e915d56fc6c.tar.gz rss-bridge-6c4098d6558c33a5fcb2a8bc9fb29e915d56fc6c.tar.zst rss-bridge-6c4098d6558c33a5fcb2a8bc9fb29e915d56fc6c.zip |
Revert "all: Use ->remove() instead of ->outertext = ''"
This reverts commit 052844f5e13c71ceefd743136a71f71226a0eefb.
There is a bug in ->remove() that causes the parser to incorrectly
identify elements in the DOM tree that shouldn't exist anymore.
References #1151
Diffstat (limited to 'bridges/RadioMelodieBridge.php')
-rw-r--r-- | bridges/RadioMelodieBridge.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bridges/RadioMelodieBridge.php b/bridges/RadioMelodieBridge.php index 8e2cf05d..fb5aca6e 100644 --- a/bridges/RadioMelodieBridge.php +++ b/bridges/RadioMelodieBridge.php @@ -38,17 +38,20 @@ class RadioMelodieBridge extends BridgeAbstract { $imgs = $textDOM->find('img[src^="http://www.radiomelodie.com/image.php]'); foreach($imgs as $img) { $img->src = $this->rewriteImage($img->src); + $article->save(); } // Remove Google Ads $ads = $article->find('div[class=adInline]'); foreach($ads as $ad) { - $ad->remove(); + $ad->outertext = ''; + $article->save(); } // Remove Radio Melodie Logo $logoHTML = $article->find('div[id=logoArticleRM]', 0); - $logoHTML->remove(); + $logoHTML->outertext = ''; + $article->save(); $author = $article->find('p[class=AuthorName]', 0)->plaintext; @@ -62,7 +65,8 @@ class RadioMelodieBridge extends BridgeAbstract { $header = '<img src="' . $picture[0] . '"/>'; // Remove the Date and Author part - $textDOM->find('div[class=AuthorDate]', 0)->remove(); + $textDOM->find('div[class=AuthorDate]', 0)->outertext = ''; + $article->save(); $text = $textDOM->innertext; $item['content'] = '<h1>' . $item['title'] . '</h1>' . $date . '<br/>' . $header . $text; $this->items[] = $item; |