Welcome Guest, Not a member yet? Register   Sign In
Form multiplies newlines
#1

[eluser]Unknown[/eluser]
Is This A Bug?

I've bumped into a small problem and want to know if anyone else got it.

I've got this simple form with a textarea, no biggie. The problem shows when i edit a predefined text.

If this is what i got by default:
Code:
this is some default text
with a line break

now, if i just submit this without doing any changes, this is what i get in the PHP $_POST variable:
Code:
this is some default text

with a line break

the \n or \r character seem to multiply by itself. The next time i save the text the \n multiply again, giving me 4 \n in a row and so on.

Summary:
Step 1. I pre-fill the textarea with the contents mentioned in the first code block above
Step 2. I submit the same content
Step 3. I run the following code before i do anything else:
Code:
echo '<pre>'. $this->input->post('content') .'</pre>'; die;
Step 4. The newline are multiplied as in the second code block above
#2

[eluser]alex.sash[/eluser]
Yes, I confirm I've just encountered the same multiline $_POST variables behavoir, just after upgrade to 2.0.
Server: Apache, windows.
#3

[eluser]alex.sash[/eluser]
I found this issue posted as bug here by by Yannick Vincent.
I tried proposed workaround, although claimed to be "ugly" - it works for me (needs to add missed underscores before "construct").
#4

[eluser]Unknown[/eluser]
thanks alex. the workaround worked great for me too
#5

[eluser]vee[/eluser]
this is my way to fix it.
http://ellislab.com/forums/viewthread/180827/




Theme © iAndrew 2016 - Forum software by © MyBB