google-code-backups / get-simple-cms

Automatically exported from code.google.com/p/get-simple-cms
GNU General Public License v3.0
0 stars 0 forks source link

Corrupt XML files from control characters #281

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
http://get-simple.info/forum/post/21549/#p21549

Original issue reported on code.google.com by ccagle8 on 10 Jan 2012 at 2:04

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r633.

Original comment by ccagle8 on 17 Jan 2012 at 7:03

GoogleCodeExporter commented 8 years ago
It strips ctrl chars, but seems to strip linefeeds too.
http://get-simple.info/forum/post/21794/#p21794

Original comment by carnav on 18 Jan 2012 at 4:33

GoogleCodeExporter commented 8 years ago

Original comment by ccagle8 on 18 Jan 2012 at 9:31

GoogleCodeExporter commented 8 years ago
I've been playing a bit, and this works for me:

In admin/inc/basic.php, function safe_slash_html, after the if sentence, remove 
the "$text = preg_replace ..." line.
insert this instead, to strip the character that breaks the page:

$text = str_replace(chr(12), '', $text);

You may also want to put back that patch you did in r530 to strip another 
control code, but maybe as chr(3) instead of pasting the char:

$text = str_replace(chr(3), ' ', $text); //remove hard return symbol that comes 
with Photoshop & others

Original comment by carnav on 20 Jan 2012 at 6:52

GoogleCodeExporter commented 8 years ago
Thanks Carnav. I will add that in a sec

Original comment by ccagle8 on 20 Jan 2012 at 2:14

GoogleCodeExporter commented 8 years ago
added already

Original comment by ccagle8 on 28 Jan 2012 at 1:51