Commit 08d4a4b8b63b9d468cf5edfe9f7e837125fe51e3

Authored by Lucas Schmoeller da Silva
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
ieducar/intranet/educar_acervo_autor_cad.php
@@ -81,6 +81,9 @@ class indice extends clsCadastro @@ -81,6 +81,9 @@ class indice extends clsCadastro
81 foreach( $registro AS $campo => $val ) // passa todos os valores obtidos no registro para atributos do objeto 81 foreach( $registro AS $campo => $val ) // passa todos os valores obtidos no registro para atributos do objeto
82 $this->$campo = $val; 82 $this->$campo = $val;
83 83
  84 + $this->nm_autor = stripslashes($this->nm_autor);
  85 + $this->nm_autor = htmlspecialchars($this->nm_autor);
  86 +
84 $obj_permissoes = new clsPermissoes(); 87 $obj_permissoes = new clsPermissoes();
85 if( $obj_permissoes->permissao_excluir( 594, $this->pessoa_logada, 11 ) ) 88 if( $obj_permissoes->permissao_excluir( 594, $this->pessoa_logada, 11 ) )
86 { 89 {
@@ -137,6 +140,8 @@ class indice extends clsCadastro @@ -137,6 +140,8 @@ class indice extends clsCadastro
137 $this->pessoa_logada = $_SESSION['id_pessoa']; 140 $this->pessoa_logada = $_SESSION['id_pessoa'];
138 @session_write_close(); 141 @session_write_close();
139 142
  143 + $this->nm_autor = addslashes($this->nm_autor);
  144 +
140 $obj_permissoes = new clsPermissoes(); 145 $obj_permissoes = new clsPermissoes();
141 $obj_permissoes->permissao_cadastra( 594, $this->pessoa_logada, 11, "educar_acervo_autor_lst.php" ); 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,6 +167,8 @@ class indice extends clsCadastro
162 $this->pessoa_logada = $_SESSION['id_pessoa']; 167 $this->pessoa_logada = $_SESSION['id_pessoa'];
163 @session_write_close(); 168 @session_write_close();
164 169
  170 + $this->nm_autor = addslashes($this->nm_autor);
  171 +
165 $obj_permissoes = new clsPermissoes(); 172 $obj_permissoes = new clsPermissoes();
166 $obj_permissoes->permissao_cadastra( 594, $this->pessoa_logada, 11, "educar_acervo_autor_lst.php" ); 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,7 +372,8 @@ class clsPmieducarAcervoAutor
372 } 372 }
373 if( is_string( $str_nm_autor ) ) 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 $whereAnd = " AND "; 377 $whereAnd = " AND ";
377 } 378 }
378 if( is_string( $str_descricao ) ) 379 if( is_string( $str_descricao ) )