CakePHP: Sobrecarga Esterilizar
-
26-09-2019 - |
Pregunta
En la reciente versión de CakePHP 1.3.4 descubrí que Desinfección :: html vuelve entidades dobles html codificada -. A causa del cuarto parámetro recién agregado de htmlentities 'double_encode'
Aquí es un boleto correspondiente en CakePHP: http://cakephp.lighthouseapp.com/projects/42648/tickets/1152-sanitizehtml-needs-double_encode-parameter-in-htmlentities
Desde que necesito utilizar CakePHP 1.3.4 de PHP 5.2.14 tengo que cambiar el parámetro double_encode. ¿Hay una manera de sobrecargar el método de Desinfección :: html en pastel, así que no tengo que jugar con el núcleo?
Solución
Puede subclase en el directorio /app/libs
:
App::import('Sanitize');
class MySanitize extends Sanitize {
public static function html(...) {
...
}
}
tendrá que cambiar al uso MySanitize
en lugar de Sanitize
, pero eso no debería ser un gran problema. Un texto find / sustitución puede hacerse cargo de él si se está utilizando mucho ya.