koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ambrose Li
Subject: [Koha-cvs] CVS: koha/misc/translator text-extract2.pl,1.20,1.21
Date: Fri, 13 Feb 2004 21:50:58 -0800

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
                    )
      }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]