From 5662dff5cbc7da64a387195bf7716508487ef004 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 5 Oct 2016 18:56:54 +0200 Subject: [PATCH 1/2] [Webfail] Fix titles with umlauts --- bridges/WebfailBridge.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bridges/WebfailBridge.php b/bridges/WebfailBridge.php index bf2e47af..86a668cc 100644 --- a/bridges/WebfailBridge.php +++ b/bridges/WebfailBridge.php @@ -64,7 +64,7 @@ class WebfailBridge extends BridgeAbstract { $news = $html->find('#main', 0)->find('a.wf-list-news'); foreach($news as $element){ $item = array(); - $item['title'] = $element->find('div.wf-news-title', 0)->innertext; + $item['title'] = $this->fixTitle($element->find('div.wf-news-title', 0)->innertext); $item['uri'] = $this->getURI() . $element->href; $img = $element->find('img.wf-image', 0)->src; @@ -97,7 +97,7 @@ class WebfailBridge extends BridgeAbstract { $articles = $html->find('article'); foreach($articles as $article){ $item = array(); - $item['title'] = $article->find('a', 1)->innertext; + $item['title'] = $this->fixTitle($article->find('a', 1)->innertext); // Webfail shares videos or images if(!is_null($article->find('img.wf-image', 0))){ // Image type @@ -121,6 +121,11 @@ class WebfailBridge extends BridgeAbstract { } } + private function fixTitle($title){ + // This fixes titles that include umlauts (in German language) + return html_entity_decode($title, ENT_COMPAT | ENT_HTML401, 'UTF-8'); + } + private function getVideoId($onclick){ return substr($onclick, 21, 11); } From aa2442602a914abe4fad1b5d629309aab0016c3b Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Thu, 6 Oct 2016 22:04:38 +0200 Subject: [PATCH 2/2] [Webfail] Fix titles with single quotes --- bridges/WebfailBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/WebfailBridge.php b/bridges/WebfailBridge.php index 86a668cc..e15f3ffc 100644 --- a/bridges/WebfailBridge.php +++ b/bridges/WebfailBridge.php @@ -123,7 +123,7 @@ class WebfailBridge extends BridgeAbstract { private function fixTitle($title){ // This fixes titles that include umlauts (in German language) - return html_entity_decode($title, ENT_COMPAT | ENT_HTML401, 'UTF-8'); + return html_entity_decode($title, ENT_QUOTES | ENT_HTML401, 'UTF-8'); } private function getVideoId($onclick){