From 2aa065f85b58579dc0a0c528568b8faaf850e17a Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Wed, 20 Nov 2019 19:10:13 +0000 Subject: [PATCH] commandref_join.pl: more strict tag checking (Forum #105376) git-svn-id: https://svn.fhem.de/fhem/trunk@20552 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/commandref_join.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/commandref_join.pl b/fhem/contrib/commandref_join.pl index d084731ef..6aaf0511e 100755 --- a/fhem/contrib/commandref_join.pl +++ b/fhem/contrib/commandref_join.pl @@ -178,7 +178,12 @@ generateModuleCommandref($$;$$) $docCount++; $hasLink = ($l =~ m//gi); + if($l =~ m/<$tag ([^>]+)>/i) { + my $attr = $1; + print "*** $lang $mod line $line: $tag with attributes (apart ". + "from class) is not allowed\n" if($attr !~ m/class="[^"]*"/); + } + $tagcount{$tag} +=()= ($l =~ /<$tag( [^>]+)?>/gi); $tagcount{$tag} -=()= ($l =~ /<\/$tag>/gi); if($tagcount{$tag} < 0) { print "*** $lang $fPath: negative tagcount for $tag, line $line\n"