create new tag
, view all tags

Bug: Form values are incorrectly encoded

In Form values, certain text must be encoded to not break surrounding structures. (In cairo, theses are \n and ", dakar adds %). Due to the encoding chosen, if one puts the encoded value of certain text in, incorrect values are returned.

Test case

In a text field of a form,

  • enter %_Q_%, and it will end up returning " in view (and next edit); in Dakar this will be %_P_"_P_%.
  • enter %_N_%, and it will disappear


TWiki version: TWikiRelease02Sep2004, Dakar
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin

-- SamHasler, ThomasWeigert - 12 May 2005

Follow up

If we just used a standard encoding, such as HTML entities, this would not happen.

-- CrawfordCurrie - 12 May 2005

I was thinking that also, but don't know how to invoke the browser to do it. I did not want to recode all the HTML encoding mechanism. Remember that the HTML encoding usually is only during the transport.

-- ThomasWeigert - 12 May 2005

You can just call TWiki::entityEncode(), and decodue using TWiki::entityDecode(). But that isn't the full solution. As PeterThoeny pointed out when I suggested this before, there is still the problem that to maintain compatibility you have to decode topics that still use the old encoding, and it is that decoding step that is the cause of the errors.

-- CrawfordCurrie - 13 May 2005

Fix record


This problem is due to the symmetrical nature of the encoding. If we were to use, for example, %_Q_$ to encode ", and similar for the other values, this problem would not arise.

-- ThomasWeigert - 12 May 2005

OK, solved by incrementing the format number in topics to 1.1 and putting in a proper encoding (very close to the url encoding, but it encodes a different set of characters). DevelopBranch only, of course.

SVN 4356

-- CrawfordCurrie - 06 Jun 2005

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2005-06-06 - CrawfordCurrie
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.