Skip to content

Instantly share code, notes, and snippets.

@turingmachine
Created April 8, 2009 14:25
Show Gist options
  • Save turingmachine/91793 to your computer and use it in GitHub Desktop.
Save turingmachine/91793 to your computer and use it in GitHub Desktop.
--- ./lib/TWiki/Plugins/SpreadSheetPlugin/Calc.pm.old 2009-04-08 16:08:28.000000000 +0200
+++ ./lib/TWiki/Plugins/SpreadSheetPlugin/Calc.pm 2009-04-08 16:06:59.000000000 +0200
@@ -1075,8 +1075,10 @@
for my $i (0 .. $#list ) {
$val = $list[$i] || "";
# search first float pattern, skip over HTML tags
- if( $val =~ /^\s*(?:<[^>]*>)*\$?([\-\+]*[0-9\.]+).*/o ) {
- $list[$i] = $1; # untainted variable, possibly undef
+ if( $val =~ /^\s*(?:<[^>]*>)*\$?([\-\+]*[0-9\.,]+).*/o ) {
+ my $number = $1;
+ $number =~ s/,//;
+ $list[$i] = $number; # untainted variable, possibly undef
} else {
$list[$i] = undef;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment