views:

450

answers:

2

Hi, I'm using Zend Framework and it is escaping single quotes, double quotes and backslashes. This is done even before I save the text to the database so I guess it is done by the Zend_Form object.

Are those the only characters it escapes? Does Zend have a function to undo this escaping or a way to turn off this escaping?

The text is code so I really need it to show as the user sent it, it is gonna be highlighted by geshi or show as plain text.

Simply using stripslashes removes the unwanted backslashes, but also removes backslashes the user intentionally typed.

Thanks

+1  A: 

This depends on how you are getting the post data. The following method will give you the raw output of any POST data:

$request = $this->getRequest();
if ($request->isPost()) {
    $post = $request->getPost(); // $post becomes an array of post variables
}
Andy Baird
A: 

I found I had magic_quotes_gpc activated in this machine... turning it off makes it work as it should. Thanks andybaird for the help anyway.

carlosz