Skip to content

Commit

Permalink
Item13302: changing a form breaks char encoding
Browse files Browse the repository at this point in the history
At some point CGI started to treat form values differently, i.e.
when they are byte strings as we have it inside Foswiki holding
unicode chars.

This is at least a problem using CGI-4.13. It recodes them using
html entities, but fails to guess the char encoding thus freaking
the strings up.

Older CGIs < 4.00 are not affecting Foswiki.

The work-around is to avoild the HTML generators in CGI as far
as possible and just do plain string operations.
  • Loading branch information
MichaelDaum committed Mar 10, 2015
1 parent 603cb4c commit 0fe87a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/lib/Foswiki/UI/ChangeForm.pm
Expand Up @@ -109,8 +109,9 @@ sub generate {
$page = $topicObject->expandMacros($page);
$page = $topicObject->renderTML($page);

$text =
CGI::hidden( -name => 'text', -value => scalar( $q->param('text') ) );
$text = '<input type="hidden" name="text" value="'
. scalar( $q->param('text') ) . '"/>';

$page =~ s/%TEXT%/$text/g;

return $page;
Expand Down

0 comments on commit 0fe87a4

Please sign in to comment.