*** TWiki.pm Sat Feb 1 17:55:22 2003 --- TWiki.pm.mod Sat Apr 12 16:35:42 2003 *************** *** 1748,1764 **** # encoding by browser) sub handleUrlEncode { ! my( $theStr, $doExtract ) = @_; ! $theStr = extractNameValuePair( $theStr ) if( $doExtract ); ! $theStr =~ s/[\n\r]/\%3Cbr\%20\%3E/g; ! $theStr =~ s/\s+/\%20/g; ! $theStr =~ s/\&/\%26/g; ! $theStr =~ s/\/\%3E/g; ! $theStr =~ s/([\x7f-\xff])/'%' . unpack( "H*", $1 ) /ge; ! return $theStr; } # ========================= --- 1748,1785 ---- # encoding by browser) sub handleUrlEncode { ! #my( $theStr, $doExtract ) = @_; # $theStr could be large, don't copy ! $_[0] = extractNameValuePair( $_[0] ) if( $_[1] ); ! # % is unsafe ! # $_[0] =~ s/\%/\%25/g; ! $_[0] =~ s/[\n\r]/\%3Cbr\%20\%3E/g; ! # Reserved characters ! $_[0] =~ s/;/\%3B/g; ! $_[0] =~ s/\//\%2F/g; ! $_[0] =~ s/\?/\%3F/g; ! $_[0] =~ s/\:/\%3A/g; ! $_[0] =~ s/@/\%40/g; ! $_[0] =~ s/=/\%3D/g; ! $_[0] =~ s/\&/\%26/g; ! # Unsafe characters ! $_[0] =~ s/\s+/\%20/g; ! $_[0] =~ s/\/\%3E/g; ! $_[0] =~ s/\"/\%22/g; ! $_[0] =~ s/#/\%23/g; ! $_[0] =~ s/\{/\%7B/g; ! $_[0] =~ s/\}/\%7D/g; ! $_[0] =~ s/\|/\%7C/g; ! $_[0] =~ s/\\/\%5C/g; ! $_[0] =~ s/\^/\%5E/g; ! $_[0] =~ s/~/\%7E/g; ! $_[0] =~ s/\[/\%5B/g; ! $_[0] =~ s/\]/\%5D/g; ! $_[0] =~ s/`/\%60/g; ! $_[0] =~ s/([\x7f-\xff])/'%' . unpack( "H*", $1 ) /ge; ! return $_[0]; } # =========================