From 4b7fbe4188f0788b9b3c4831a147d67a90988058 Mon Sep 17 00:00:00 2001 From: teromene Date: Thu, 19 Apr 2018 21:00:18 +0200 Subject: [PATCH] DansTonChatBridge: test before accessing plaintext --- bridges/DansTonChatBridge.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php index a7b9284..0983bff 100644 --- a/bridges/DansTonChatBridge.php +++ b/bridges/DansTonChatBridge.php @@ -15,7 +15,12 @@ class DansTonChatBridge extends BridgeAbstract { foreach($html->find('div.item') as $element) { $item = array(); $item['uri'] = $element->find('a', 0)->href; - $item['title'] = 'DansTonChat ' . html_entity_decode($element->find('h3 a', 0)->plaintext, ENT_QUOTES); + $titleContent = $element->find('h3 a', 0); + if($titleContent) { + $item['title'] = 'DansTonChat ' . html_entity_decode($titleContent->plaintext, ENT_QUOTES); + } else { + $item['title'] = 'DansTonChat'; + } $item['content'] = $element->find('div.item-content a', 0)->innertext; $this->items[] = $item; }