From 2b70a31cb1bef03e8898ac1a67c3ba1b700f4246 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@20666 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/pre-commit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/pre-commit b/fhem/contrib/pre-commit index ef1fc5077..e9633995d 100755 --- a/fhem/contrib/pre-commit +++ b/fhem/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";