diff --git a/Core/Lib/Widget/WidgetLink.php b/Core/Lib/Widget/WidgetLink.php index 4ef898e886..12af0d00b3 100644 --- a/Core/Lib/Widget/WidgetLink.php +++ b/Core/Lib/Widget/WidgetLink.php @@ -1,7 +1,7 @@ + * Copyright (C) 2017-2022 Carlos Garcia Gomez * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -16,8 +16,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ + namespace FacturaScripts\Core\Lib\Widget; +use FacturaScripts\Core\Base\Utils; + /** * Description of WidgetLink * @@ -28,18 +31,19 @@ class WidgetLink extends WidgetText { /** - * * @param string $inside * @param string $titleurl * * @return string */ - protected function onclickHtml($inside, $titleurl = '') + protected function onclickHtml($inside, $titleurl = ''): string { if (empty($this->value)) { return empty($titleurl) ? $inside : '' . $inside . ''; } - return '' . $inside . ''; + return Utils::isValidUrl($this->value) ? + '' . $inside . '' : + $inside; } }