From cb830a0f7c245ee14032bc5ab579da62dd507ef8 Mon Sep 17 00:00:00 2001 From: humano Date: Tue, 17 Mar 2020 16:22:06 -0500 Subject: [PATCH] correcion en visualizacion de imagenes --- images/secure/index.php | 10 +++++++--- js/scripts.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/images/secure/index.php b/images/secure/index.php index c166816..84383cb 100644 --- a/images/secure/index.php +++ b/images/secure/index.php @@ -2,13 +2,13 @@ session_start(); // Comprobamos si existe la variable /*if ( !isset ( $_SESSION['id'] ) ) { - // Si no existe + // Si no existe header("Location: ../nodisponible.jpg"); // echo "hola mundo2"; }*/ if(!isset($_GET['file']) ){ header("Location: ../sinimagen.jpg"); - + } include("../../includes/datos.php"); $dir="$path_images_secure/"; @@ -21,15 +21,19 @@ if ((!$file=realpath($dir.$_GET['file'])) $ref=@$_SERVER['HTTP_REFERER']; if (strpos($ref,'https://')===0 || strpos($ref,'https')!==0){ $mime=array( + 'JPEG'=>'image/jpeg', + 'JPG'=>'image/jpeg', 'jpg'=>'image/jpeg', + 'jpeg'=>'image/jpeg', 'png'=>'image/png', + 'PNG'=>'image/png', 'mid'=>'audio/x-midi', 'wav'=>'audio/x-wav' ); if(@$mime[substr($file,-3)] =='') { header('Location: ../pixel.png'); - + exit(); } $stat=stat($file); diff --git a/js/scripts.js b/js/scripts.js index 7bce07c..d8d000c 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -13,7 +13,7 @@ function delayTimer() { function revisarSession(sesion){ tiempo = "30"; gavela="19"; - timestamp = Math.round(Date.now() /1000) + timestamp = Math.round(Date.now() /1000); inicio = sesion;//leerCookie("timestamp"); transcurrido = (timestamp - inicio); transcurrido_minutos = Math.round(transcurrido/60);