From c8ef31bac66b4ad710405886c4afdda7ae7eb0fb Mon Sep 17 00:00:00 2001 From: ORelio Date: Fri, 23 Oct 2015 12:19:12 +0200 Subject: [PATCH] [NextInpact] Fix php notice message For non-premium articles, a notice is generated because of trying to get property from a non-object. Fixed that with a proper check using is_object --- bridges/NextInpactBridge.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php index c91a4837..c070038a 100644 --- a/bridges/NextInpactBridge.php +++ b/bridges/NextInpactBridge.php @@ -8,7 +8,7 @@ * @homepage http://www.nextinpact.com/ * @description Returns the newest articles. * @maintainer qwertygc -* @update 2015-09-05 +* @update 2015-10-23 */ class NextInpactBridge extends BridgeAbstract { @@ -25,9 +25,9 @@ class NextInpactBridge extends BridgeAbstract { $text = '

'.$html2->find('span.sub_title', 0)->innertext.'

' .'

-

' .'
'.$html2->find('div[itemprop=articleBody]', 0)->innertext.'
'; - $premium_article = $html2->find('h2.title_reserve_article', 0)->innertext; - if (strlen($premium_article) > 0) - $text = $text.'

'.$premium_article.'

'; + $premium_article = $html2->find('h2.title_reserve_article', 0); + if (is_object($premium_article)) + $text = $text.'

'.$premium_article->innertext.'

'; return $text; }