From 08d4a4b8b63b9d468cf5edfe9f7e837125fe51e3 Mon Sep 17 00:00:00 2001 From: Lucas Schmoeller da Silva Date: Wed, 18 Mar 2015 17:24:20 -0300 Subject: [PATCH] Adicionado tratamentos no cadastro e busca de autores --- ieducar/intranet/educar_acervo_autor_cad.php | 7 +++++++ ieducar/intranet/include/pmieducar/clsPmieducarAcervoAutor.inc.php | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ieducar/intranet/educar_acervo_autor_cad.php b/ieducar/intranet/educar_acervo_autor_cad.php index 5704b54..ab543a4 100644 --- a/ieducar/intranet/educar_acervo_autor_cad.php +++ b/ieducar/intranet/educar_acervo_autor_cad.php @@ -81,6 +81,9 @@ class indice extends clsCadastro foreach( $registro AS $campo => $val ) // passa todos os valores obtidos no registro para atributos do objeto $this->$campo = $val; + $this->nm_autor = stripslashes($this->nm_autor); + $this->nm_autor = htmlspecialchars($this->nm_autor); + $obj_permissoes = new clsPermissoes(); if( $obj_permissoes->permissao_excluir( 594, $this->pessoa_logada, 11 ) ) { @@ -137,6 +140,8 @@ class indice extends clsCadastro $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); + $this->nm_autor = addslashes($this->nm_autor); + $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_cadastra( 594, $this->pessoa_logada, 11, "educar_acervo_autor_lst.php" ); @@ -162,6 +167,8 @@ class indice extends clsCadastro $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); + $this->nm_autor = addslashes($this->nm_autor); + $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_cadastra( 594, $this->pessoa_logada, 11, "educar_acervo_autor_lst.php" ); diff --git a/ieducar/intranet/include/pmieducar/clsPmieducarAcervoAutor.inc.php b/ieducar/intranet/include/pmieducar/clsPmieducarAcervoAutor.inc.php index 1d03fca..bfef604 100644 --- a/ieducar/intranet/include/pmieducar/clsPmieducarAcervoAutor.inc.php +++ b/ieducar/intranet/include/pmieducar/clsPmieducarAcervoAutor.inc.php @@ -372,7 +372,8 @@ class clsPmieducarAcervoAutor } if( is_string( $str_nm_autor ) ) { - $filtros .= "{$whereAnd} nm_autor LIKE '%{$str_nm_autor}%'"; + $str_nm_autor = addslashes($str_nm_autor); + $filtros .= "{$whereAnd} nm_autor ILIKE ('%{$str_nm_autor}%')"; $whereAnd = " AND "; } if( is_string( $str_descricao ) ) -- libgit2 0.21.2