1
0
forked from qwerty/milfs

correcion en visualizacion de imagenes

This commit is contained in:
humano 2020-03-17 16:22:06 -05:00
parent 6c47a5da23
commit cb830a0f7c
2 changed files with 8 additions and 4 deletions

View File

@ -2,13 +2,13 @@
session_start(); session_start();
// Comprobamos si existe la variable // Comprobamos si existe la variable
/*if ( !isset ( $_SESSION['id'] ) ) { /*if ( !isset ( $_SESSION['id'] ) ) {
// Si no existe // Si no existe
header("Location: ../nodisponible.jpg"); header("Location: ../nodisponible.jpg");
// echo "hola mundo2"; // echo "hola mundo2";
}*/ }*/
if(!isset($_GET['file']) ){ if(!isset($_GET['file']) ){
header("Location: ../sinimagen.jpg"); header("Location: ../sinimagen.jpg");
} }
include("../../includes/datos.php"); include("../../includes/datos.php");
$dir="$path_images_secure/"; $dir="$path_images_secure/";
@ -21,15 +21,19 @@ if ((!$file=realpath($dir.$_GET['file']))
$ref=@$_SERVER['HTTP_REFERER']; $ref=@$_SERVER['HTTP_REFERER'];
if (strpos($ref,'https://')===0 || strpos($ref,'https')!==0){ if (strpos($ref,'https://')===0 || strpos($ref,'https')!==0){
$mime=array( $mime=array(
'JPEG'=>'image/jpeg',
'JPG'=>'image/jpeg',
'jpg'=>'image/jpeg', 'jpg'=>'image/jpeg',
'jpeg'=>'image/jpeg',
'png'=>'image/png', 'png'=>'image/png',
'PNG'=>'image/png',
'mid'=>'audio/x-midi', 'mid'=>'audio/x-midi',
'wav'=>'audio/x-wav' 'wav'=>'audio/x-wav'
); );
if(@$mime[substr($file,-3)] =='') { if(@$mime[substr($file,-3)] =='') {
header('Location: ../pixel.png'); header('Location: ../pixel.png');
exit(); exit();
} }
$stat=stat($file); $stat=stat($file);

View File

@ -13,7 +13,7 @@ function delayTimer() {
function revisarSession(sesion){ function revisarSession(sesion){
tiempo = "30"; tiempo = "30";
gavela="19"; gavela="19";
timestamp = Math.round(Date.now() /1000) timestamp = Math.round(Date.now() /1000);
inicio = sesion;//leerCookie("timestamp"); inicio = sesion;//leerCookie("timestamp");
transcurrido = (timestamp - inicio); transcurrido = (timestamp - inicio);
transcurrido_minutos = Math.round(transcurrido/60); transcurrido_minutos = Math.round(transcurrido/60);