cvs: docweb /www/rfc rfc-proposal-show.php

From: Date: Fri, 10 Sep 2004 19:11:47 +0000
Subject: cvs: docweb /www/rfc rfc-proposal-show.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-261@lists.php.net to get a copy of this message
vincent Fri Sep 10 15:11:47 2004 EDT Modified files: /docweb/www/rfc rfc-proposal-show.php Log: Just to be on the safe side.. http://cvs.php.net/diff.php/docweb/www/rfc/rfc-proposal-show.php?r1=1.7&r2=1.8&ty=u Index: docweb/www/rfc/rfc-proposal-show.php diff -u docweb/www/rfc/rfc-proposal-show.php:1.7 docweb/www/rfc/rfc-proposal-show.php:1.8 --- docweb/www/rfc/rfc-proposal-show.php:1.7 Fri Aug 27 14:00:33 2004 +++ docweb/www/rfc/rfc-proposal-show.php Fri Sep 10 15:11:47 2004 @@ -19,7 +19,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright Copyright (c) 1997-2004 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: rfc-proposal-show.php,v 1.7 2004/08/27 18:00:33 vincent Exp $ + * @version $Id: rfc-proposal-show.php,v 1.8 2004/09/10 19:11:47 vincent Exp $ */ /** @@ -29,10 +29,12 @@ require_once '../../include/lib_general.inc.php'; if (isset($_GET['get']) AND !empty($_GET['get'])) { - if (file_exists('./../../files/' . $_GET['get']) && strlen($_GET['get']) == 32 && - strpos($_GET['get'], "..") === FALSE) { + $get = basename($_GET['get']); + + if (file_exists('./../../files/' . $get) && strlen($get) == 32 && + strpos($get, "..") === FALSE) { - $hash = sqlite_escape_string($_GET['get']); + $hash = sqlite_escape_string($get); $sql = 'SELECT pkg_filehash FROM package_proposals WHERE pkg_filehash LIKE "%'.$hash.'%"'; $res = sqlite_query($dbh->connection, $sql); $files = sqlite_fetch_single($res); @@ -50,9 +52,9 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Content-Type: octet-stream"); - header("Content-Length: " . filesize('./../../files/' . $_GET['get'])); + header("Content-Length: " . filesize('./../../files/' . $get)); header("Content-Disposition: attachment; filename=".stripslashes($file)); - echo file_get_contents('./../../files/' . $_GET['get']); + echo file_get_contents('./../../files/' . $get); exit; } exit;

« previous php.doc.web (#261) next »