[Koha-cvs] CVS: koha/misc/translator text-extract2.pl,1.20,1.21

Ambrose Li acli at users.sourceforge.net
Sat Feb 14 06:50:58 CET 2004


Update of /cvsroot/koha/koha/misc/translator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3141

Modified Files:
	text-extract2.pl 
Log Message:
More correct version of previous change


Index: text-extract2.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/text-extract2.pl,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** text-extract2.pl	14 Feb 2004 05:46:38 -0000	1.20
--- text-extract2.pl	14 Feb 2004 05:50:55 -0000	1.21
***************
*** 30,37 ****
  
  # Hideous stuff
! use vars qw( $re_directive );
  BEGIN {
      # $re_directive must not do any backreferences
      $re_directive = q{<(?:(?i)(?:!--\s*)?\/?TMPL_(?:VAR|LOOP|INCLUDE|IF|ELSE|UNLESS)(?:\s+(?:[a-zA-Z][-a-zA-Z0-9]*=)?(?:'[^']*'|"[^"]*"|[^\s<>]+))*\s*(?:--)?)>};
  }
  
--- 30,39 ----
  
  # Hideous stuff
! use vars qw( $re_directive $re_directive_ref );
  BEGIN {
      # $re_directive must not do any backreferences
      $re_directive = q{<(?:(?i)(?:!--\s*)?\/?TMPL_(?:VAR|LOOP|INCLUDE|IF|ELSE|UNLESS)(?:\s+(?:[a-zA-Z][-a-zA-Z0-9]*=)?(?:'[^']*'|"[^"]*"|[^\s<>]+))*\s*(?:--)?)>};
+     # As above but only TMPL_VAR and TMPL_INCLUDE (those that can emit a value)
+     $re_directive_ref = q{<(?:(?i)(?:!--\s*)?\/?TMPL_(?:VAR|INCLUDE)(?:\s+(?:[a-zA-Z][-a-zA-Z0-9]*=)?(?:'[^']*'|"[^"]*"|[^\s<>]+))*\s*(?:--)?)>};
  }
  
***************
*** 81,89 ****
  	$attr{+lc($key)} = [$key, $val, $val_orig, $i];
  	$s = $rest;
! 	warn "Warning: Attribute should be quoted"
  		. (defined $lc? " near line $lc": '') . ": $val_orig\n"
  		if $val_orig !~ /^['"]/ && (
  			($pedantic_p && $val =~ /[^-\.A-Za-z0-9]/s)
! 			|| $val =~ /[<>]/s	# this covers $re_directive, too
  		    )
      }
--- 83,91 ----
  	$attr{+lc($key)} = [$key, $val, $val_orig, $i];
  	$s = $rest;
! 	warn "Warning: Attribute probably should be quoted"
  		. (defined $lc? " near line $lc": '') . ": $val_orig\n"
  		if $val_orig !~ /^['"]/ && (
  			($pedantic_p && $val =~ /[^-\.A-Za-z0-9]/s)
! 			|| $val =~ /$re_directive_ref/s
  		    )
      }





More information about the Koha-cvs mailing list