From f3f8d437d55709eb61ef40677b9a9103fd18a953 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Gomez Date: Mon, 23 May 2022 12:12:11 +0200 Subject: [PATCH] Modified the WidgetLink to not generate links with javascript urls. ------ Modificado el WidgetLink para no generar enlaces con urls javascript. --- Core/Lib/Widget/WidgetLink.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; } }