From 6e61c83476cae09e2a5d67742650a0f54c6bad9c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 2 Jun 2022 23:53:27 +0200 Subject: [PATCH] common: silence warning in showlink about unused href --- common.inc.plp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common.inc.plp b/common.inc.plp index a1eb3e5..898e8bb 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -233,10 +233,9 @@ BEGIN { sub showlink { my ($title, $href, $selected) = @_; - return sprintf( - !$href ? '%s' : - $selected ? '%s' : '%s', - EscapeHTML($title), EscapeHTML($href) - ); + EscapeHTML($title); + return $title if not $href; + return "$title" if $selected; + return sprintf '%s', EscapeHTML($href), $title; } -- 2.30.0