From 66f0c08ec8eb5a131ff9cd31949fbaafd33f9b97 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Wed, 2 Oct 2019 13:13:05 -0400 Subject: [PATCH] cleanup after our cto --- view/View.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/view/View.class.php b/view/View.class.php index 5ad91042..99c3734e 100644 --- a/view/View.class.php +++ b/view/View.class.php @@ -182,10 +182,8 @@ class View $dom = new PHPHtmlParser\Dom(); $dom->load($html, ['cleanupInput' => false, 'removeDoubleSpace' => false, 'removeSmartyScripts' => false]); - foreach ($dom->find('body a') as $link) - { - if (static::isLinkExternal($link->getAttribute('href'), $domain)) - { + foreach ($dom->find('body a') as $link) { + if ($link->getAttribute('href') && static::isLinkExternal($link->getAttribute('href'), $domain)) { $link->setAttribute('rel', "noopener noreferrer"); } }