summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/file_proxy.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-01-11 17:54:33 -0800
committerBharat Mediratta <bharat@menalto.com>2011-01-11 17:54:33 -0800
commit09d34696a12ae15f6c7378a64b2359465b2d7277 (patch)
tree11fc68b6bfb3faf251f9f2a5b77607c9222bf36d /modules/gallery/controllers/file_proxy.php
parente3df9c1611861cc5a294d4c758b6220712d1e698 (diff)
Update comments to annotate what data is where during the process.
Follow-on for #1518.
Diffstat (limited to 'modules/gallery/controllers/file_proxy.php')
-rw-r--r--modules/gallery/controllers/file_proxy.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 0400d7c4..98f4e839 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -29,9 +29,11 @@
class File_Proxy_Controller extends Controller {
const ALLOW_PRIVATE_GALLERY = true;
public function __call($function, $args) {
- // request_uri: gallery3/var/trunk/albums/foo/bar.jpg
+ // request_uri: gallery3/var/albums/foo/bar.jpg?m=1234
$request_uri = rawurldecode(Input::instance()->server("REQUEST_URI"));
+ // get rid of query parameters
+ // request_uri: gallery3/var/albums/foo/bar.jpg
$request_uri = preg_replace("/\?.*/", "", $request_uri);
// var_uri: gallery3/var/
@@ -43,8 +45,11 @@ class File_Proxy_Controller extends Controller {
throw new Kohana_404_Exception();
}
+ // file_uri: albums/foo/bar.jpg
$file_uri = substr($request_uri, strlen($var_uri));
+ // type: albums
+ // path: foo/bar.jpg
list ($type, $path) = explode("/", $file_uri, 2);
if ($type != "resizes" && $type != "albums" && $type != "thumbs") {
throw new Kohana_404_Exception();