Immediately it is worth noting that with the release of php 6, this article will not be relevant, but for now .../**
* .
*
* , magic_quotes_gpc.
*
* @category Zend_Controller_Plugin
*/
class Singular_Controller_Plugin_StripMagicQuotes extends Zend_Controller_Plugin_Abstract
{
/**
* , Zend_Controller_Front .
*
* @param Zend_Controller_Request_Abstract $request
* @return void
*/
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
/** magic_quotes_gpc */
if (get_magic_quotes_gpc()) {
/** */
$ params = $request->getParams();
/** "exStripSlashes" */
array_walk_recursive($ params , array($ this , 'exStripSlashes' ));
/** */
$request->setParams($ params );
}
}
/**
* .
*
* @param mixed $value
* @param mixed $key
* @return void
*/
private function exStripSlashes(&$ value , $key)
{
/** */
$ value = stripslashes($ value );
}
}
* This source code was highlighted with Source Code Highlighter ./** - */
$front = Zend_Controller_Front::getInstance();
/** */
$front->registerPlugin( new Singular_Controller_Plugin_StripMagicQuotes());
* This source code was highlighted with Source Code Highlighter .Source: https://habr.com/ru/post/72915/
All Articles