]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - lib/CGI/Ex/Fill.pm
CGI::Ex 2.08
[chaz/p5-CGI-Ex] / lib / CGI / Ex / Fill.pm
index ee6d2a15922860c1064c75224a9879ecb761b145..6c407806605e35e3fe02031db4ca52b7171d092e 100644 (file)
@@ -7,7 +7,7 @@ CGI::Ex::Fill - Fast but compliant regex based form filler
 =cut
 
 ###----------------------------------------------------------------###
-#  Copyright 2006 - Paul Seamons                                     #
+#  Copyright 2007 - Paul Seamons                                     #
 #  Distributed under the Perl Artistic License without warranty      #
 ###----------------------------------------------------------------###
 
@@ -24,7 +24,7 @@ use vars qw($VERSION
 use base qw(Exporter);
 
 BEGIN {
-    $VERSION   = '2.02';
+    $VERSION   = '2.08';
     @EXPORT    = qw(form_fill);
     @EXPORT_OK = qw(fill form_fill html_escape get_tagval_by_key swap_tagval_by_key);
 };
@@ -185,7 +185,7 @@ sub fill {
     ### First pass
     ### swap <input > form elements if they have a name
     $$ref =~ s{
-        (<input \s (?: ([\"\'])(?:|.*?[^\\])\2 | [^>] )* >) # nested html ok
+        (<input \s (?: ([\"\'])(?:|.*?[^\\])\2 | [^>] )+ >) # nested html ok
         }{
             ### get the type and name - intentionally exlude names with nested "'
             my $tag   = $1;
@@ -249,7 +249,7 @@ sub fill {
         my $opts = substr($$ref, $start[$i], $close[$i] - $start[$i]);
         $opts =~ s{
             (<select \s                                 # opening
-             (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )* # nested html ok
+             (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )+ # nested html ok
              >)                                         # end of tag
             }{}sxi || next;
         next if ! $opts;
@@ -303,7 +303,7 @@ sub fill {
         my $oldval = substr($$ref, $start[$i] + $offset, $close[$i] - $start[$i]);
         $oldval =~ s{
             (<textarea \s                               # opening
-             (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )* # nested html ok
+             (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )+ # nested html ok
              >)                                         # end of tag
             }{}sxi || next;
         my $tag  = $1;
This page took 0.021229 seconds and 4 git commands to generate.