r66273 - in /branches/upstream/libtemplate-plugin-javascript-perl/current: Changes META.yml lib/Template/Plugin/JavaScript.pm t/01_test.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Dec 25 00:22:44 UTC 2010


Author: jawnsy-guest
Date: Sat Dec 25 00:22:38 2010
New Revision: 66273

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66273
Log:
[svn-upgrade] new version libtemplate-plugin-javascript-perl (0.02)

Modified:
    branches/upstream/libtemplate-plugin-javascript-perl/current/Changes
    branches/upstream/libtemplate-plugin-javascript-perl/current/META.yml
    branches/upstream/libtemplate-plugin-javascript-perl/current/lib/Template/Plugin/JavaScript.pm
    branches/upstream/libtemplate-plugin-javascript-perl/current/t/01_test.t

Modified: branches/upstream/libtemplate-plugin-javascript-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-javascript-perl/current/Changes?rev=66273&op=diff
==============================================================================
--- branches/upstream/libtemplate-plugin-javascript-perl/current/Changes (original)
+++ branches/upstream/libtemplate-plugin-javascript-perl/current/Changes Sat Dec 25 00:22:38 2010
@@ -1,4 +1,7 @@
 Revision history for Perl extension Template::Plugin::JavaScript
+
+0.02  Wed Dec 15 11:42:31 PST 2010
+        - Escapes HTML tags too (cho45)
 
 0.01  Fri Aug 20 01:00:39 2004
 	- original version

Modified: branches/upstream/libtemplate-plugin-javascript-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-javascript-perl/current/META.yml?rev=66273&op=diff
==============================================================================
--- branches/upstream/libtemplate-plugin-javascript-perl/current/META.yml (original)
+++ branches/upstream/libtemplate-plugin-javascript-perl/current/META.yml Sat Dec 25 00:22:38 2010
@@ -1,12 +1,22 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Template-Plugin-JavaScript
-version:      0.01
-version_from: lib/Template/Plugin/JavaScript.pm
-installdirs:  site
+--- #YAML:1.0
+name:               Template-Plugin-JavaScript
+version:            0.02
+abstract:           ~
+author:  []
+license:            unknown
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
 requires:
-    Template:                      0
-    Test::More:                    0.32
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+    Template:    0
+    Test::More:  0.32
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: branches/upstream/libtemplate-plugin-javascript-perl/current/lib/Template/Plugin/JavaScript.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-javascript-perl/current/lib/Template/Plugin/JavaScript.pm?rev=66273&op=diff
==============================================================================
--- branches/upstream/libtemplate-plugin-javascript-perl/current/lib/Template/Plugin/JavaScript.pm (original)
+++ branches/upstream/libtemplate-plugin-javascript-perl/current/lib/Template/Plugin/JavaScript.pm Sat Dec 25 00:22:38 2010
@@ -2,7 +2,7 @@
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.01';
+$VERSION = '0.02';
 
 require Template::Plugin;
 use base qw(Template::Plugin);
@@ -21,11 +21,15 @@
     local $_ = shift;
     return '' unless defined $_;
 
+    s!\\!\\\\!g;
     s!(['"])!\\$1!g;
     s!\n!\\n!g;
     s!\f!\\f!g;
     s!\r!\\r!g;
     s!\t!\\t!g;
+    s!<!\\x3c!g;
+    s!>!\\x3e!g;
+    s!&!\\x26!g;
     $_;
 }
 

Modified: branches/upstream/libtemplate-plugin-javascript-perl/current/t/01_test.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-javascript-perl/current/t/01_test.t?rev=66273&op=diff
==============================================================================
--- branches/upstream/libtemplate-plugin-javascript-perl/current/t/01_test.t (original)
+++ branches/upstream/libtemplate-plugin-javascript-perl/current/t/01_test.t Sat Dec 25 00:22:38 2010
@@ -1,5 +1,7 @@
 use strict;
 use Template::Test;
+
+use lib 'lib';
 
 test_expect(\*DATA);
 
@@ -12,3 +14,32 @@
 --expect--
 document.write("\nHere\'s some text going on.\n");
 
+--test--
+[% USE JavaScript -%]
+document.write("[% FILTER js %]
+You & I
+[% END %]");
+--expect--
+document.write("\nYou \x26 I\n");
+
+--test--
+[% USE JavaScript -%]
+var t = "[% FILTER js %]
+\"+alert(1)//
+[% END %]";
+--expect--
+var t = "\n\\\"+alert(1)//\n";
+
+--test--
+[% USE JavaScript -%]
+<script type="text/javascript">
+var t = "[% FILTER js %]
+\"</script><script>
+alert(1)//
+[% END %]";
+</script>
+--expect--
+<script type="text/javascript">
+var t = "\n\\\"\x3c/script\x3e\x3cscript\x3e\nalert(1)//\n";
+</script>
+




More information about the Pkg-perl-cvs-commits mailing list