Skip to content

Commit

Permalink
Item11366: Prevent double encoding.
Browse files Browse the repository at this point in the history
Also comment out reversing the &lt; encoding of <nop>   This change
should have fixed that too.

git-svn-id: http://svn.foswiki.org/branches/Release01x01@14054 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Feb 22, 2012
1 parent 0afb0fe commit 8d4bcb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions UnitTestContrib/test/unit/FormattingTests.pm
Expand Up @@ -1799,7 +1799,6 @@ sub _check_rendered_linktext {
sub test_sanity_link_tests {
my $this = shift;

$this->expect_failure('TODO: fix Item11366 ampersand escaping in squabs');
$this->_create_link_test_fixtures();
while ( my ( $linktext, $expected ) = each %link_tests ) {

Expand All @@ -1817,7 +1816,7 @@ sub test_ampersand_querystring {

$this->expect_failure('TODO: fix Item11366 ampersand escaping in squabs');
$this->_check_rendered_linktext(
"$this->{test_topic}?q=r&s=t",
"$this->{test_topic}?q=r&amp;s=t",
{
address => "$this->{test_topic}",
query => 'q=r&s=t'
Expand Down
4 changes: 3 additions & 1 deletion core/lib/Foswiki/Render.pm
Expand Up @@ -677,12 +677,14 @@ sub _renderExistingWikiWord {
my $tooltip = _linkToolTipInfo( $this, $web, $topic );
$attrs{title} = $tooltip if $tooltip;

my $aFlag = CGI::autoEscape(0);
my $link = CGI::a( \%attrs, $text );
CGI::autoEscape($aFlag);

# When we pass the tooltip text to CGI::a it may contain
# <nop>s, and CGI::a will convert the < to &lt;. This is a
# basic problem with <nop>.
$link =~ s/&lt;nop&gt;/<nop>/g;
#$link =~ s/&lt;nop&gt;/<nop>/g;
return $link;
}

Expand Down

0 comments on commit 8d4bcb0

Please sign in to comment.