ZF-4510: Zend_Filter_StripSlashes
Description
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Filter * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: $ */
/** * @see Zend_Filter_Interface */ require_once 'Zend/Filter/Interface.php';
/** * @category Zend * @package Zend_Filter * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Filter_StripSlashes implements Zend_Filter_Interface {
/**
* Defined by Zend_Filter_Interface
*
* Returns $value without newline control characters
*
* @param string $value
* @return string
*/
public function filter ($value)
{
return stripslashes($value);
}
}
Comments
Posted by François Lecluse (openbsdiste) on 2009-03-10T02:10:53.000+0000
filter function should be better with a test of magic quotes...
public function filter ($value) { if (get_magic_quotes_gpc ()) { $value = stripslashes ($value); } return $value; }
Posted by Ben Scholzen (dasprid) on 2009-03-10T02:14:44.000+0000
Not really.
a) magic_quotes_gpc should be disabled for ZF projects anyway. b) A filter is not only supposed for values comming from GPC, but also for example values from a web service.
Posted by Joe Gornick (jgornick) on 2009-12-29T00:10:39.000+0000
Here's my version:
Curious to know if this is something that should be added to ZF? Would Zend_Filter_Callback do the job?
Posted by Rob Allen (rob) on 2012-11-20T20:53:40.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.