From 08b3f4c111c4a4bb9d4a70a8a7b1a27297f10738 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 6 Dec 2019 11:06:33 +0000 Subject: [PATCH] pre-commit: add better tagcount checking (Forum #105376) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20666 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- contrib/pre-commit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/pre-commit b/contrib/pre-commit index ef1fc5077..e9633995d 100755 --- a/contrib/pre-commit +++ b/contrib/pre-commit @@ -129,7 +129,12 @@ foreach my $row (split("\n", $fList)) { $hasLink = ($l =~ m//gi); + if($l =~ m/<$tag ([^>]+)>/i) { + my $attr = $1; + err $fName, "$lang line $line: $tag with attributes (apart ". + "from class) is not allowed\n" ; + } + $tagcount{$tag} +=()= ($l =~ /<$tag( [^>]+)?>/gi); $tagcount{$tag} -=()= ($l =~ /<\/$tag>/gi); if($tagcount{$tag} < 0) { err $fName, "$lang: negative tagcount for $tag, line $line";