예제 #1
0
function thumb_GET(Web &$w)
{
    $filename = str_replace("..", "", FILE_ROOT . $w->getPath());
    if (is_file($filename)) {
        $width = $w->request("w", FileService::$_thumb_width);
        $height = $w->request("h", FileService::$_thumb_height);
        require_once 'phpthumb/ThumbLib.inc.php';
        $thumb = PhpThumbFactory::create($filename);
        $thumb->adaptiveResize($width, $height);
        header("Content-Type: image/png");
        $thumb->show();
        exit;
    }
}
예제 #2
0
파일: path.php 프로젝트: itillawarra/cmfive
function path_GET(Web &$w)
{
    // make sure we secure from /../../etc/passwd attacks!!
    $filename = str_replace("..", "", FILE_ROOT . $w->getPath());
    $w->sendFile($filename);
}