This question about Missing functionality: Needs followup in Tasks

URLPARAM and newline="
" doesn't work

Hi,

in http://trac.foswiki.org/browser/trunk/core/lib/Foswiki/Macros/URLPARAM.pm you can see in handleURLPARAMValue() that $newLine is expanded BEFORE doing the encoding.

How is then something like expected to work correctly?

Proposal diff which is tested and works on my installation.

@@ -4021,7 +4011,7 @@
         }
     }
     if ( defined $value ) {
-        # $value =~ s/\r?\n/$newLine/go if ( defined $newLine );
+        $value =~ s/\r?\n/$newLine/go if ( defined $newLine );
         if ( $encode =~ /^entit(y|ies)$/i ) {
             $value = entityEncode($value);
         }
@@ -4041,8 +4031,6 @@
                                               # entity encode ' " < > and %
             $value =~ s/([<>%'"])/'&#'.ord($1).';'/ge;
         }
-        # schaefer - 2010-08-26 - should be done here, else gets encoded.
-        $value =~ s/\r?\n/$newLine/go if ( defined $newLine );
     }
     unless ( defined $value ) {
         $value = $params->{default};


Sorry, you should have created a task for that, not a support question...

-- OlivierRaginel - 13 Sep 2010

QuestionForm edit

Subject Missing functionality
Extension
Version
Status Needs followup in Tasks
Topic revision: r2 - 13 Sep 2010, OlivierRaginel
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy