Bug: Double Quotes not Handled Correctly in TWiki Forms
In a TWiki form the double quote '"' is replaced by
" to avoid
HTML confusion, it should be
". Moreover the replacement is done for
text inputs which is understandable but also for
textarea inputs which is useless since double quotes are allowed (I think) in a
textarea.
Test case
Just type '"' in a TWiki form (input
text or
textarea), save it and edit it again, you will see the
" garbage.
Environment
| TWiki version: |
1/2003 |
| TWiki plugins: |
DefaultPlugin, PhpPlugin, ConditionalIncludePlugin, InternalVariablesPlugin, CalendarPlugin, ConditionalPlugin, EditTablePlugin, InterwikiPlugin, SmiliesPlugin, SpreadSheetPlugin, TWikiDrawPlugin, TopicVarsPlugin |
| Server OS: |
Linux 2.4 (Debian) |
| Web server: |
Apache 1.3 |
| Perl version: |
5.8.0 |
| Client OS: |
Linux |
| Web Browser: |
Mozilla |
--
XavierREDON - 16 Jun 2003
Follow up
Fix record
The "bug" could be corrected by :
- adding a ';' after
" around line 252 in TWiki/Form.pm ;
- removing the double quote conversion about line 264 in
TWiki/Form.pm (the conversion in the textarea case is useless).
--
XavierREDON - 16 Jun 2003
Good spot. The solution suggested however won't fix the problem (having tried them).
There's two problems:
-
" is converted to " - this isn't correct - it should be " .
- The conversion happens before
& is converted to &
The upshot is
- You type :
"
- You get :
&#34
Which
really isn't what's wanted!
The fix is to convert
" to
" after converting every
& s to
& .
Patch against
BeijingRelease attached. To use the patch:
- cd twiki home
- cd lib/TWiki
- cp DOUBLEQUOTE_BUG.patch .
- patch -p0 <DOUBLEQUOTE_BUG.patch
-- MS - 16 Jun 2003
OK for the patch with
" after
& remplacement but why do you do the replacement in the case of a
textarea input, a double quote should not be a problem in this case ?
--
XavierREDON - 16 Jun 2003
I agree it shouldn't be a problem.
-- MS - 16 Jun 2003
Fixed with some additional changes. In
TWikiAlphaRelease.
--
PeterThoeny - 18 Jun 2003
Category:
TWikiPatches