View file gallery/gallery.php

File size: 752B
<?php
// mod by Golem http://veplog.ru

require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";

if(isset($_GET['image'])) {$image=check($_GET['image']); } else {$image = "";}

if (preg_match('|^[a-z0-9_\.\-]+$|i', $image)){
$ext = strtolower(substr($image, strrpos($image, '.') + 1));

if($ext=="jpg" || $ext=="gif" || $ext=="png"){
if($ext=="jpg"){$ext="jpeg";}

$filename = BASEDIR."local/datagallery/$image";
$filename = file_get_contents($filename);
header('Content-Disposition: inline; filename="'.$image.'"');
header("Content-type: image/$ext");
header("Content-Length: ".strlen($filename));
echo $filename;
}}
exit;
?>