[pmwiki-devel] Multi-line field with PmForm

DaveG pmwiki at solidgone.com
Thu Mar 4 18:18:47 CST 2010



On 3/4/2010 7:16 AM, Petko Yotov wrote:
> On Thursday 04 March 2010 05:57:23, DaveG wrote :
>> When using PmForm it looks like multi-line fields are stored in the base
>> page with each %0a on a physically separate line, rather than the normal
>> PmWiki way of storing the entire page text on a single line.
>>
>> Here's a snip of what I mean. I've edited from the real thing to avoid
>> email wrapping, but this demonstrates the end effect:
>>
>> text=(:pmform savedata:)(:name:test
>> %0amulti
>> %0aline:)%0a(:email:djg:)%0a
>>
>>
>> I believe it's caused by the definition of the $PageTextVarPatterns,
>> since form data saved using an alternate pattern I also use does not
>> cause this problem.
>
> What exactly are the new lines? \n or \r, or aren't these just spaces with the
> long line wrapped?
They are \r characters.


> It could be just carriage returns \r that weren't removed by PmWiki before
> saving the page.
>
>> 1] Does it matter that the line is split? I've seen no ill-effects so
>> far, but I'm not sure.
>
> It may seem to work fine now, but I think for compatibility in the future, it
> is better to fix it.
>
> You should be able to remove the \r by adding such a replacement pattern to
> config.php:
>
>    $PmFormPostPatterns['/\r/'] = '';
>
> I think this should be added as default in the pmform.php script.
Adding the $PmFormPostPatterns pattern fixed the problem. I'll create a 
PITS entry. Thanks.


  ~ ~ Dave



More information about the pmwiki-devel mailing list