Welcome Guest, Not a member yet? Register   Sign In
textarea duplicates line breaks
#11

[eluser]InsiteFX[/eluser]
CodeIgniter User Guide - Typography Helper
Not sure if this will solve your problems but give it a try.
Code:
nl2br_except_pre()
Converts newlines to <br /> tags unless they appear within <pre> tags. This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags.

Usage example:
Code:
$string = nl2br_except_pre($string);

InsiteFX
#12

[eluser]Freeze Dried Pop[/eluser]
[quote author="mikkelz" date="1302174534"]I take it that updating the Input class in /system/core is a better option than creating a custom input class to override that bit of code?

Or what is the recommended method for resolving these bugs until a new version is released?

Edit:

I kind of answered my own question by going ahead and modifying the Input class with the latest change on bitbucket.

Line #542:

Code:
$str = str_replace(array("\r\n", "\r", "\r\n\n"), PHP_EOL, $str);

It feels "cleaner" than hacking in a custom class for something small like this.

Edit 2:

Thanks for the link JuanitoDelCielo[/quote]
Cheers, i've implemented this and it's fixed now.

Was racking my brains for a good hour before realising it might be something to do with Code Igniter. That's the last time I douby my knowledge of simple HTML.




Theme © iAndrew 2016 - Forum software by © MyBB