Commit 08d4a4b8b63b9d468cf5edfe9f7e837125fe51e3
1 parent
21c1f8fe
Exists in
master
Adicionado tratamentos no cadastro e busca de autores
Permitindo que sejam cadastrados e buscados autores com apóstrofos portabilis/ieducar#118
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
ieducar/intranet/educar_acervo_autor_cad.php
| ... | ... | @@ -81,6 +81,9 @@ class indice extends clsCadastro |
| 81 | 81 | foreach( $registro AS $campo => $val ) // passa todos os valores obtidos no registro para atributos do objeto |
| 82 | 82 | $this->$campo = $val; |
| 83 | 83 | |
| 84 | + $this->nm_autor = stripslashes($this->nm_autor); | |
| 85 | + $this->nm_autor = htmlspecialchars($this->nm_autor); | |
| 86 | + | |
| 84 | 87 | $obj_permissoes = new clsPermissoes(); |
| 85 | 88 | if( $obj_permissoes->permissao_excluir( 594, $this->pessoa_logada, 11 ) ) |
| 86 | 89 | { |
| ... | ... | @@ -137,6 +140,8 @@ class indice extends clsCadastro |
| 137 | 140 | $this->pessoa_logada = $_SESSION['id_pessoa']; |
| 138 | 141 | @session_write_close(); |
| 139 | 142 | |
| 143 | + $this->nm_autor = addslashes($this->nm_autor); | |
| 144 | + | |
| 140 | 145 | $obj_permissoes = new clsPermissoes(); |
| 141 | 146 | $obj_permissoes->permissao_cadastra( 594, $this->pessoa_logada, 11, "educar_acervo_autor_lst.php" ); |
| 142 | 147 | |
| ... | ... | @@ -162,6 +167,8 @@ class indice extends clsCadastro |
| 162 | 167 | $this->pessoa_logada = $_SESSION['id_pessoa']; |
| 163 | 168 | @session_write_close(); |
| 164 | 169 | |
| 170 | + $this->nm_autor = addslashes($this->nm_autor); | |
| 171 | + | |
| 165 | 172 | $obj_permissoes = new clsPermissoes(); |
| 166 | 173 | $obj_permissoes->permissao_cadastra( 594, $this->pessoa_logada, 11, "educar_acervo_autor_lst.php" ); |
| 167 | 174 | ... | ... |
ieducar/intranet/include/pmieducar/clsPmieducarAcervoAutor.inc.php
| ... | ... | @@ -372,7 +372,8 @@ class clsPmieducarAcervoAutor |
| 372 | 372 | } |
| 373 | 373 | if( is_string( $str_nm_autor ) ) |
| 374 | 374 | { |
| 375 | - $filtros .= "{$whereAnd} nm_autor LIKE '%{$str_nm_autor}%'"; | |
| 375 | + $str_nm_autor = addslashes($str_nm_autor); | |
| 376 | + $filtros .= "{$whereAnd} nm_autor ILIKE ('%{$str_nm_autor}%')"; | |
| 376 | 377 | $whereAnd = " AND "; |
| 377 | 378 | } |
| 378 | 379 | if( is_string( $str_descricao ) ) | ... | ... |