From f981da7494cd094d45a5e21159642dd54f688bdb Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 15 Jul 2019 14:28:47 +0200 Subject: [PATCH] Bug 23050: Fix tab's id to avoid compatibility issues MDN says: Using characters except ASCII letters, digits, '_', '-' and '.' may cause compatibility problems, as they weren't allowed in HTML 4. Though this restriction has been lifted in HTML5, an ID should start with a letter for compatibility. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- catalogue/detail.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 1103d2ee1c..e86a115c4c 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -77,8 +77,8 @@ if ( C4::Context->preference('UseKohaPlugins') && foreach my $tab_plugin (@tab_plugins) { my @biblio_tabs = $tab_plugin->intranet_catalog_biblio_tab(); foreach my $tab (@biblio_tabs) { - $tab->{id} = $tab->{title}; - $tab->{id} =~ s/[^\w]+/-/g; + $tab->{id} = 'tab-' + $tab->{title}; + $tab->{id} =~ s/[^0-9A-Za-z]+/-/g; push @tabs, $tab, } } -- 2.39.5