Ver Mensaje Individual
  #37 (permalink)  
Antiguo 13/05/2010, 04:00
Avatar de Flow89
Flow89
 
Fecha de Ingreso: abril-2010
Ubicación: Valladolid
Mensajes: 346
Antigüedad: 14 años
Puntos: 1
Respuesta: Seguridad en PHP [Importante];

Cita:
Iniciado por Heli0s Ver Mensaje
Se me olvidaba una cosa, que como mínimo te quitará un error, tu no usas sessiones, y si no haces un session_start() el array $_SESSION no existe, por lo tanto voy a realizar unos cambios para que detecte.

Código PHP:
<?php
function getClearString($var){
    if(!
is_array($var)){
        return 
addslashes(stripslashes(htmlentities($var)));
    } else {
        return 
$var;
    }
}
if(
is_array($_GET))
$_GET array_map("getClearString"$_GET);
if(
is_array($_POST))
$_POST array_map("getClearString"$_POST);
if(
is_array($_COOKIE))
$_COOKIE array_map("getClearString"$_COOKIE);
if(
is_array($_SESSION))
$_SESSION array_map("getClearString"$_SESSION);

?>
Este es el nuevo código para que no de error aunque no haya un session_start antes.

Un saludo
Código:
Fatal error: Cannot redeclare getclearstring() (previously declared in 
/home/a7366460/public_html/loginpanel/seguridad.php:2) 
in /home/a7366460/public_html/loginpanel/seguridad.php on line 8