From 051a7ae27a49c7a5687c2ee32b92962d490218de Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 27 Oct 2009 20:20:32 -0700 Subject: [PATCH] Refix #812, by removing the decoding in file_proxy instead of not encoding in Item_Model when creating the relative_path_cache. --- modules/gallery/controllers/file_proxy.php | 4 ---- modules/gallery/models/item.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index 8cb90c5024..acfd6eb998 100644 --- a/modules/gallery/controllers/file_proxy.php +++ b/modules/gallery/controllers/file_proxy.php @@ -32,10 +32,6 @@ public function __call($function, $args) { $request_uri = $this->input->server("REQUEST_URI"); $request_uri = preg_replace("/\?.*/", "", $request_uri); - // Unescape %7E (~), %20 ( ) and %27 (') - // @todo: figure out why we have to do this and unescape everything appropriate - $request_uri = str_replace(array("%7E", "%20", "%27"), array("~", " ", "'"), $request_uri); - // var_uri: http://example.com/gallery3/var/ $var_uri = url::file("var/"); diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 63ab3598ca..fc0f019329 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -294,7 +294,7 @@ private function _build_relative_caches() { ->orderby("left_ptr", "ASC") ->get() as $row) { // Don't encode the names segment - $names[] = $row->name; + $names[] = rawurlencode($row->name); $slugs[] = rawurlencode($row->slug); } $this->relative_path_cache = implode($names, "/");