Skip to content

Commit

Permalink
Revert "Item13477: Compatibility with UTF-8 core on Foswiki 1.2"
Browse files Browse the repository at this point in the history
This reverts commit 52ea281.

The problem is in the javascript code that url encodes post data.
  • Loading branch information
gac410 committed Jun 28, 2015
1 parent 52ea281 commit aec7ecb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/Foswiki/Plugins/TopicInteractionPlugin/Attachments.pm
Expand Up @@ -277,7 +277,6 @@ sub urlEncode {
my ($infoOrText, $property) = @_;

my $text = defined($property)?$infoOrText->{$property}:$infoOrText;
$text = Foswiki::encode_utf8($text) if ( $Foswiki::UNICODE );
$text =~ s/([^0-9a-zA-Z-_.:~!*\/])/'%'.sprintf('%02X',ord($1))/ge;

return $text;
Expand Down
9 changes: 3 additions & 6 deletions lib/Foswiki/Plugins/TopicInteractionPlugin/Core.pm
Expand Up @@ -197,7 +197,6 @@ sub prepareAction {

# read parameters
my $topic = $params->{topic} || $session->{webTopic};
$topic = Foswiki::decode_utf8($topic) if ( $Foswiki::UNICODE );
my $web = $session->{webName};

($web, $topic) = Foswiki::Func::normalizeWebTopicName($web, $topic);
Expand Down Expand Up @@ -274,10 +273,8 @@ sub urlDecode {

$value =~ s/%([\da-f]{2})/chr(hex($1))/gei;
my $session = $Foswiki::Plugins::SESSION;
unless ($Foswiki::UNICODE) {
my $downgradedValue = $session->UTF82SiteCharSet($value);
$value = $downgradedValue if defined $downgradedValue;
}
my $downgradedValue = $session->UTF82SiteCharSet($value);
$value = $downgradedValue if defined $downgradedValue;

$value =~ s/^\s+//g;
$value =~ s/\s+$//g;
Expand Down Expand Up @@ -322,7 +319,7 @@ sub printJSONRPC {
}

$message = JSON::to_json($message, {pretty=>1});
$response->body($message);
$response->print($message);
}

##############################################################################
Expand Down

0 comments on commit aec7ecb

Please sign in to comment.