summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/file_proxy.php
diff options
context:
space:
mode:
authorbharat <bharat@coral.ithought.org>2009-06-01 01:07:05 -0400
committerbharat <bharat@coral.ithought.org>2009-06-01 01:07:05 -0400
commit297fb737ac1e8b5a50a3220cb0841457b042ac92 (patch)
treecf720eab5b62a432a0dbe8af894dec7b45f1bfc5 /modules/gallery/controllers/file_proxy.php
parentc96b81db6521c8d2b0f3601557011661b0a2d9b8 (diff)
Convert %7E to ~ when proxying files to work around Firefox's overzealous security model.
Diffstat (limited to 'modules/gallery/controllers/file_proxy.php')
-rw-r--r--modules/gallery/controllers/file_proxy.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 2037ad98..1901bd9f 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -32,9 +32,13 @@ class File_Proxy_Controller extends Controller {
$request_uri = $this->input->server("REQUEST_URI");
$request_uri = preg_replace("/\?.*/", "", $request_uri);
+ // Firefox converts ~ to %7E breaking our url comparison, below. Convert that back here.
+ $request_uri = str_replace("%7E", "~", $request_uri);
+
// var_uri: http://example.com/gallery3/var/
$var_uri = url::file("var/");
+
// Make sure that the request is for a file inside var
$offset = strpos($request_uri, $var_uri);
if ($offset === false) {