
interchange-cvs at icdevgroup
Sep 14, 2009, 8:32 AM
Post #1 of 1
(305 views)
Permalink
|
|
[SCM] Interchange branch, master, updated. 3083ff99f60a8df02b4f170fc59e02924ae9fde6
|
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Interchange". The branch, master has been updated via 3083ff99f60a8df02b4f170fc59e02924ae9fde6 (commit) from 1bb3f72eea092ef2a1ebc6796156b42b28a8e144 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3083ff99f60a8df02b4f170fc59e02924ae9fde6 Author: David Christensen <david [at] endpoint> Date: Thu Mar 12 14:53:24 2009 -0500 Converted untaint regexes which assumed 8-bit characters to unicode-friendly equivalents ----------------------------------------------------------------------- Summary of changes and diff: code/SystemTag/row.coretag | 2 +- code/UserTag/bar_button.tag | 2 +- dist/lib/UI/pages/admin/item_option_phantom.html | 8 ++++---- .../pages/include/Options/old/item_option_modular | 8 ++++---- lib/Vend/Config.pm | 8 ++++---- lib/Vend/Form.pm | 2 +- lib/Vend/Interpolate.pm | 12 ++++++------ lib/Vend/MakeCat.pm | 4 ++-- lib/Vend/Parse.pm | 2 +- lib/Vend/Ship.pm | 2 +- lib/Vend/Table/Common.pm | 2 +- lib/Vend/Util.pm | 6 +++--- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/code/SystemTag/row.coretag b/code/SystemTag/row.coretag index e28ecbc..57cbf8b 100644 --- a/code/SystemTag/row.coretag +++ b/code/SystemTag/row.coretag @@ -161,7 +161,7 @@ sub { while( $text =~ s!\[col(?:umn)?\s+ ([^\]]+) \] - ([\000-\377]*?) + ((?s:.)*?) \[/col(?:umn)?\] !!ix ) { $spec = $1; $col = $2; diff --git a/code/UserTag/bar_button.tag b/code/UserTag/bar_button.tag index 167c8dd..83c9885 100644 --- a/code/UserTag/bar_button.tag +++ b/code/UserTag/bar_button.tag @@ -17,7 +17,7 @@ sub { my ($page, $current, $html) = @_; $current = $Global::Variable->{MV_PAGE} if ! $current; - $html =~ s:\[selected\]([\000-\377]*)\[/selected]::i; + $html =~ s!\[selected\]((?s:.)*)\[/selected]!!i; my $alt = $1; return $html if $page ne $current; return $alt; diff --git a/dist/lib/UI/pages/admin/item_option_phantom.html b/dist/lib/UI/pages/admin/item_option_phantom.html index f58f2fc..0a2cfb8 100644 --- a/dist/lib/UI/pages/admin/item_option_phantom.html +++ b/dist/lib/UI/pages/admin/item_option_phantom.html @@ -132,10 +132,10 @@ #Log("body first:\n$body\n\n") unless $Scratch->{debug_body}; $body =~ s!(\{\w+)\%2e(\w+\})!$1.$2!g; $body =~ s!\{([-\w.]+)\}!$ref->{$1}!g; - $body =~ s!\{([-\w.]+)\|([\000-\377]*?)\}!$ref->{$1} || $2!eg; - $body =~ s!\{([-\w.]+)\s+([\000-\377]*?)\}! $ref->{$1} ? $2 : ''!eg; - $body =~ s!\{([-\w.]+)\?\}([\000-\377]*?){/\1\?\}! $ref->{$1} ? $2 : ''!eg; - $body =~ s!\{([-\w.]+):\}([\000-\377]*?){/\1:\}! $ref->{$1} ? '' : $2!eg; + $body =~ s!\{([-\w.]+)\|((?s:.)*?)\}!$ref->{$1} || $2!eg; + $body =~ s!\{([-\w.]+)\s+((?s:.)*?)\}! $ref->{$1} ? $2 : ''!eg; + $body =~ s!\{([-\w.]+)\?\}((?s:.)*?){/\1\?\}! $ref->{$1} ? $2 : ''!eg; + $body =~ s!\{([-\w.]+):\}((?s:.)*?){/\1:\}! $ref->{$1} ? '' : $2!eg; #Log("body now:\n$body\n\n") unless $Scratch->{debug_body}++; return $body; } diff --git a/dist/lib/UI/pages/include/Options/old/item_option_modular b/dist/lib/UI/pages/include/Options/old/item_option_modular index 667365b..4c1cba2 100644 --- a/dist/lib/UI/pages/include/Options/old/item_option_modular +++ b/dist/lib/UI/pages/include/Options/old/item_option_modular @@ -194,10 +194,10 @@ #Log("body first:\n$body\n\n") unless $Scratch->{debug_body}; $body =~ s!(\{\w+)\%2e(\w+\})!$1.$2!g; $body =~ s!\{([-\w.]+)\}!$ref->{$1}!g; - $body =~ s!\{([-\w.]+)\|([\000-\377]*?)\}!$ref->{$1} || $2!eg; - $body =~ s!\{([-\w.]+)\s+([\000-\377]*?)\}! $ref->{$1} ? $2 : ''!eg; - $body =~ s!\{([-\w.]+)\?\}([\000-\377]*?){/\1\?\}! $ref->{$1} ? $2 : ''!eg; - $body =~ s!\{([-\w.]+):\}([\000-\377]*?){/\1:\}! $ref->{$1} ? '' : $2!eg; + $body =~ s!\{([-\w.]+)\|((?s:.)*?)\}!$ref->{$1} || $2!eg; + $body =~ s!\{([-\w.]+)\s+((?s:.)*?)\}! $ref->{$1} ? $2 : ''!eg; + $body =~ s!\{([-\w.]+)\?\}((?s:.)*?){/\1\?\}! $ref->{$1} ? $2 : ''!eg; + $body =~ s!\{([-\w.]+):\}((?s:.)*?){/\1:\}! $ref->{$1} ? '' : $2!eg; #Log("body now:\n$body\n\n") unless $Scratch->{debug_body}++; return $body; } diff --git a/lib/Vend/Config.pm b/lib/Vend/Config.pm index ffdc918..e385f06 100644 --- a/lib/Vend/Config.pm +++ b/lib/Vend/Config.pm @@ -1394,7 +1394,7 @@ sub read_container { } return undef unless $foundeot; #untaint - $value =~ /([\000-\377]*)/; + $value =~ /((?s:.)*)/; $value = $1; return $value; } @@ -1414,7 +1414,7 @@ sub read_here { } return undef unless $foundeot; #untaint - $value =~ /([\000-\377]*)/; + $value =~ /((?s:.)*)/; $value = $1; return $value; } @@ -2181,7 +2181,7 @@ sub parse_action { } # Untaint and strip this pup - $sub =~ s/^\s*([\000-\377]*\S)\s*//; + $sub =~ s/^\s*((?s:.)*\S)\s*//; $sub = $1; if($sub !~ /\s/) { @@ -5305,7 +5305,7 @@ sub parse_subroutine { $name =~ s/\s+//g; # Untainting - $value =~ /([\000-\377]*)/; + $value =~ /((?s:.)*)/; $value = $1; if(! defined $C) { diff --git a/lib/Vend/Form.pm b/lib/Vend/Form.pm index 207ed26..f1ec9b4 100644 --- a/lib/Vend/Form.pm +++ b/lib/Vend/Form.pm @@ -62,7 +62,7 @@ tag_accessories stuff. Allows user-added widgets. =cut -my $Some = '[\000-\377]*?'; +my $Some = '(?s:.)*?'; my $Codere = '[-\w#/.]+'; my $Tag = new Vend::Tags; diff --git a/lib/Vend/Interpolate.pm b/lib/Vend/Interpolate.pm index 69d8b25..9dad66c 100644 --- a/lib/Vend/Interpolate.pm +++ b/lib/Vend/Interpolate.pm @@ -69,7 +69,7 @@ the lists used in the widely employed [loop ..], [search-region ...], This module makes heavy use of precompiled regexes. You will notice variables being used in the regular expression constructs. For example, C<$All> is a -a synonym for C<[\000-\377]*>, C<$Some> is equivalent to C<[\000-\377]*?>, etc. +a synonym for C<(?s:.)*>, C<$Some> is equivalent to C<(?s:.)*?>, etc. This is not only for clarity of the regular expression, but for speed. =cut @@ -304,8 +304,8 @@ $cond_op{len} = $cond_op{length}; my %T; my %QR; -my $All = '[\000-\377]*'; -my $Some = '[\000-\377]*?'; +my $All = '(?s:.)*'; +my $Some = '(?s:.)*?'; my $Codere = '[-\w#/.]+'; my $Coderex = '[-\w:#=/.%]+'; my $Filef = '(?:%20|\s)+([^]]+)'; @@ -321,8 +321,8 @@ my $Opt = '\s*([-\w#/.]+)?'; my $T = '\]'; my $D = '[-_]'; -my $XAll = qr{[\000-\377]*}; -my $XSome = qr{[\000-\377]*?}; +my $XAll = qr{(?s:.)*}; +my $XSome = qr{(?s:.)*?}; my $XCodere = qr{[-\w#/.]+}; my $XCoderex = qr{[-\w:#=/.%]+}; my $XMandx = qr{\s+([-\w:#=/.%]+)}; @@ -3134,7 +3134,7 @@ sub tag_search_region { sub find_sort { my($text) = @_; - return undef unless defined $$text and $$text =~ s#\[sort(([\s\]])[\000-\377]+)#$1#io; + return undef unless defined $$text and $$text =~ s#\[sort(([\s\]])(?s:.)+)#$1#io; my $options = find_close_square($$text); $$text = substr( $$text,length($options) + 1 ) if defined $options; diff --git a/lib/Vend/MakeCat.pm b/lib/Vend/MakeCat.pm index 10602ea..ae3e1df 100644 --- a/lib/Vend/MakeCat.pm +++ b/lib/Vend/MakeCat.pm @@ -543,7 +543,7 @@ sub readconfig { ([^>\n]+) \s*>\s+ - ([\000-\377]*?) + ((?s:.)*?) </catalog>! $virtual{$1} = $2; ''!xieg; @@ -2112,7 +2112,7 @@ sub conf_parse_http { \s+ ([^>\n]+) \s*>\s+ - ([\000-\377]*?) + ((?s:.)*?) </virtualhost>! $virtual->{$1} = $2; ''!xieg; diff --git a/lib/Vend/Parse.pm b/lib/Vend/Parse.pm index 0383781..856d6cf 100644 --- a/lib/Vend/Parse.pm +++ b/lib/Vend/Parse.pm @@ -678,7 +678,7 @@ sub start { } # Parse tags within tags, only works if the [ is the # first character. - next unless $attr->{$trib} =~ /\[\w+[-\w]*\s*[\000-\377]*\]/; + next unless $attr->{$trib} =~ /\[\w+[-\w]*\s*(?s:.)*\]/; my $p = new Vend::Parse; $p->parse($attr->{$trib}); diff --git a/lib/Vend/Ship.pm b/lib/Vend/Ship.pm index 56f094b..a5633b2 100644 --- a/lib/Vend/Ship.pm +++ b/lib/Vend/Ship.pm @@ -346,7 +346,7 @@ sub read_shipping { $ref->{zone_name} = $zone if ! $ref->{zone_name}; } - elsif ($cost =~ /^{[\000-\377]+}$/ ) { + elsif ($cost =~ /^{(?s:.)+}$/ ) { eval { $ref = eval $cost }; } else { diff --git a/lib/Vend/Table/Common.pm b/lib/Vend/Table/Common.pm index ee49e6a..d796b3f 100644 --- a/lib/Vend/Table/Common.pm +++ b/lib/Vend/Table/Common.pm @@ -1304,7 +1304,7 @@ my %format = ( while (<IN>) { chomp; \@fields = (); - s/\\r?\\n\\r?\\n([\\000-\\377]*)// + s/\\r?\\n\\r?\\n((?s:.)*)// and \$fields[$idx] = \$1; while(s!($codere):[ \\t]*(.*)\\n?!!) { diff --git a/lib/Vend/Util.pm b/lib/Vend/Util.pm index 1d844c8..671ab6d 100644 --- a/lib/Vend/Util.pm +++ b/lib/Vend/Util.pm @@ -1030,16 +1030,16 @@ sub parse_locale { if($Vend::Cfg->{Locale}) { my $key; - $$r =~ s~\[L(\s+([^\]]+))?\]([\000-\377]*?)\[/L\]~ + $$r =~ s~\[L(\s+([^\]]+))?\]((?s:.)*?)\[/L\]~ $key = $2 || $3; defined $Vend::Cfg->{Locale}{$key} ? ($Vend::Cfg->{Locale}{$key}) : $3 ~eg; - $$r =~ s~\[LC\]([\000-\377]*?)\[/LC\]~ + $$r =~ s~\[LC\]((?s:.)*?)\[/LC\]~ find_locale_bit($1) ~eg; undef $Lang; } else { - $$r =~ s~\[L(?:\s+[^\]]+)?\]([\000-\377]*?)\[/L\]~$1~g; + $$r =~ s~\[L(?:\s+[^\]]+)?\]((?s:.)*?)\[/L\]~$1~g; } # return scalar string if one get passed initially hooks/post-receive -- Interchange _______________________________________________ interchange-cvs mailing list interchange-cvs [at] icdevgroup http://www.icdevgroup.org/mailman/listinfo/interchange-cvs
|