Archived CMSimple Support Forum

The Old CMSimple User Community
It is currently Thu Sep 02, 2010 4:37 pm

This archived CMSimple Support Forum will be locked primo June 2008. Users with a commercial licence are advised to register and use the new Official Support Forum at CMSimple.com instead. A community driven forum with free registration is found at cmsimpleforum.com.

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: Backslash stripped out of text?
PostPosted: Thu Jul 26, 2007 2:50 pm 
Offline

Joined: Tue Oct 21, 2003 6:06 pm
Posts: 38
Hi, I'm using CMSimple to document some computer procedures in my department, and since we use Windows a lot of the procedures have a backslash or two in them.

I'm using the latest CMSimple 2.9, with the built-in editor and one of the built-in templates.

The regular slash seems fine.

When I type a backslash, it looks ok, but as soon as I save the page it is stripped off.

Any clues? -Steve

PS: I ran across this in the forum from a couple years ago, but I don't quite understand it and I'm not sure if it's the same problem I'm having.

http://www.cmsimple.dk/forum/viewtopic. ... =backslash


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 27, 2007 11:52 am 
Offline
Site Admin

Joined: Mon May 12, 2003 12:36 pm
Posts: 3091
Location: Rutsker, Bornholm, Denmark
Pls check if magicquotes are off - see www.php.net/magic_quotes/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 02, 2007 3:47 pm 
Offline

Joined: Tue Oct 21, 2003 6:06 pm
Posts: 38
I checked phpinfo on my server, and it appears that magic quotes are off:

Quote:
magic_quotes_gpc Off Off
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off


Can everyone else do a backslash ( \ ) on their instance of CMSimple?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 12:24 pm 
Offline
Site Admin

Joined: Mon May 12, 2003 12:36 pm
Posts: 3091
Location: Rutsker, Bornholm, Denmark
I don't have any problems.

What happens if you slash your slash? \\


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 1:42 pm 
Offline

Joined: Tue Oct 21, 2003 6:06 pm
Posts: 38
If I type a double backslash, and save, only a single backslash is left.

If I save again, then the remaining backslash disappears also.

My PHP version is 5.2.0 and I am running it on a Windows 2003 server with IIS.

Do you think trying a different editor would help? If I go to settings -> content -> edit and manually put in back slashes I get the same problem - if there's one, it disappears on save. If there are two one will disappear on save, and then if I save again the second one disappears as well. Does this "clear" the editor as having anything to do with the problem?

Is this more likely something bad about my PHP/server configuration?

Thanks for your help. -Steve


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 7:53 am 
Offline
Site Admin

Joined: Mon May 12, 2003 12:36 pm
Posts: 3091
Location: Rutsker, Bornholm, Denmark
Just tested on my localhost - it is a bug.

Before the stripslashes is runned on the posted text, it should be tested with get_magic_quotes_gpc() like it is in the admin's edit settings (both in adm.php).

Added it to http://www.cmsimple.dk/?Downloads:Future_development


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 12:31 pm 
Offline

Joined: Tue Oct 21, 2003 6:06 pm
Posts: 38
Thanks very much for checking on it.

Can you think of any workaround I can do? Right now I'm using the ` character instead of a backslash.

-Steve


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 8:53 am 
Offline
Site Admin

Joined: Mon May 12, 2003 12:36 pm
Posts: 3091
Location: Rutsker, Bornholm, Denmark
Remove the stripslashes function on $text in adm.php


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 12:42 pm 
Offline

Joined: Tue Oct 21, 2003 6:06 pm
Posts: 38
Thanks.

I found two places in adm.php where stripslashes() is used on $text:

Line 156
Code:
   else $text = rmnl(stripslashes($text));


and Line 271
Code:
   $c[$s] = preg_replace("/<h[1-".$cf['menu']['levels']."][^>]*>(\&nbsp;| )?<\/h[1-".$cf['menu']['levels']."]>/i", "", stripslashes($text));


Which one do I change, and how do I change it?

Thanks once again! -Steve


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 1:36 pm 
Offline
Site Admin

Joined: Mon May 12, 2003 12:36 pm
Posts: 3091
Location: Rutsker, Bornholm, Denmark
change stripslashes($text) to $text - both places, I think.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 5:19 pm 
Offline

Joined: Tue Oct 21, 2003 6:06 pm
Posts: 38
harteg wrote:
change stripslashes($text) to $text - both places, I think.


That worked perfectly, thanks so much! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group