
Untitled
By: a guest on
Jul 4th, 2012 | syntax:
None | size: 0.59 KB | hits: 23 | expires: Never
Zend sanitizing input
public function init(){
$this->view->setEscape('html_entity_decode');
$this->view->setEscape('stripslashes');
}
<?php
#Tools.php
class My_Tools {
/**
* My custom escape function
*
* @param string $str String to be escaped
* @return string Escaped string
*/
static function myEscape($str) {
$str = html_entity_decode($str);
return stripslashes($str);
}
}
?>
public function init() {
require_once(APPLICATION_PATH . '/../library/My/Tools.php');
$this->view->setEscape(array('My_Tools', 'myEscape'));
}