From 1d45c47c0251d4b1b91abbb7902fd80897d567b8 Mon Sep 17 00:00:00 2001 From: acli Date: Sat, 14 Feb 2004 09:41:28 +0000 Subject: [PATCH] Fix spurious warnings if attribute is in the form foo="bar" --- misc/translator/text-extract2.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index f335145fe9..1db71a07dd 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -107,16 +107,18 @@ sub extract_attributes ($;$) { warn "Warning: TMPL_INCLUDE in attribute" . (defined $lc? " near line $lc": '') . ": $val_orig\n"; } elsif ($val =~ /$re_tmpl_var/os && $val !~ /$re_tmpl_var_escaped/os) { + # FIXME: we probably should not warn if key is "onclick" etc? :-/ my $suggest = ($key =~ /^(?:action|archive|background|cite|classid|codebase|data|datasrc|for|href|longdesc|profile|src|usemap)$/? 'URL': 'HTML'); warn_pedantic \$pedantic_tmpl_var_use_in_nonpedantic_mode_p, "Suggest ESCAPE=$suggest for TMPL_VAR in attribute \"$key\"" . (defined $lc? " near line $lc": '') . ": $val_orig" if $pedantic_p || !$pedantic_tmpl_var_use_in_nonpedantic_mode_p; } elsif ($val_orig !~ /^['"]/) { + my $t = $val; $t =~ s/$re_directive_control//os; warn_pedantic \$pedantic_attribute_error_in_nonpedantic_mode_p, "Unquoted attribute contains character(s) that should be quoted" . (defined $lc? " near line $lc": '') . ": $val_orig" - if $val =~ /[^-\.A-Za-z0-9]/s; + if $t =~ /[^-\.A-Za-z0-9]/s; } } my $s2 = $s; $s2 =~ s/$re_tmpl_endif_endloop//g; # for the next check -- 2.39.5