Page 1 of 1

stripslashes not working?

Posted: Tue Oct 24, 2006 11:45 am
by Luke
I have a method like this in my application model:

Code: Select all

public function getSafe($key){
	
		if(array_key_exists($key, $this->_fields)){
			return htmlentities(stripslashes($this->_fields[$key]->getValue()));
		}
		return null;
	
	}
It's used to escape data for output to the page, but even though I'm using this... the data comes out like this... (with the slashes still there)

Code: Select all

<div class="member_list">
   <h1>Luke\'s House</h1>
   <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean cursus dolor id neque. Vestibulum lobortis luctus augue. Nunc velit. Fusce ultrices massa nec felis. Quisque ut justo. Nulla auctor ornare lorem. Nunc sit amet eros. Phasellus ultricies est </p>
  </div>
I checked to make sure the data wasn't double backslashed in the data, and it isn't. What could be the cause of this?

Possible

Posted: Tue Oct 24, 2006 12:21 pm
by churt
Found this note on the manual page. From your previous post you probably have checked this already or it doesn't apply. Looks like a possible though.

http://us3.php.net/manual/en/function.stripslashes.php

"Note: If magic_quotes_sybase is on, no backslashes are stripped off but two apostrophes are replaced by one instead."