[Koha-cvs] CVS: koha/misc/translator text-extract2.pl,1.31,1.32
Ambrose Li
acli at users.sourceforge.net
Sat Feb 14 10:50:13 CET 2004
Update of /cvsroot/koha/koha/misc/translator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8628
Modified Files:
text-extract2.pl
Log Message:
Don't bother warning about TMPL_VAR if the key is onclick, onblur, etc.
We don't know how to warn/what to suggest, & that will only confuse people
Index: text-extract2.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/text-extract2.pl,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** text-extract2.pl 14 Feb 2004 09:41:28 -0000 1.31
--- text-extract2.pl 14 Feb 2004 09:50:11 -0000 1.32
***************
*** 108,117 ****
. (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;
--- 108,119 ----
. (defined $lc? " near line $lc": '') . ": $val_orig\n";
} elsif ($val =~ /$re_tmpl_var/os && $val !~ /$re_tmpl_var_escaped/os) {
! # XXX: we probably should not warn if key is "onclick" etc
! # XXX: there's just no reasonable thing to suggest
! my $suggest = ($key =~ /^(?:action|archive|background|cite|classid|codebase|data|datasrc|for|href|longdesc|profile|src|usemap)$/i? 'URL': 'HTML');
! undef $suggest if $key =~ /^(?:onblur|onchange|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onselect|onsubmit|onunload)$/i;
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 defined $suggest && ($pedantic_p || !$pedantic_tmpl_var_use_in_nonpedantic_mode_p);
} elsif ($val_orig !~ /^['"]/) {
my $t = $val; $t =~ s/$re_directive_control//os;
More information about the Koha-cvs
mailing list