From 55eeb8336fcfd2d2c0542e85de9da100bce1c338 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Dec 2009 09:55:28 -0800 Subject: Change the file proxy to use the expires helper to manage content expiration. Fixes ticket #953. --- modules/gallery/controllers/file_proxy.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules') diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index 65c0cb50..72c4e104 100644 --- a/modules/gallery/controllers/file_proxy.php +++ b/modules/gallery/controllers/file_proxy.php @@ -99,6 +99,12 @@ class File_Proxy_Controller extends Controller { throw new Kohana_404_Exception(); } + // Check that the content hasn't expired or it wasn't changed since cached + if (($last_modified = expires::get()) !== false && + $item->updated < $last_modified) { + expires::check(2592000); + } + // Don't try to load a directory if ($type == "albums" && $item->is_album()) { throw new Kohana_404_Exception(); @@ -111,6 +117,8 @@ class File_Proxy_Controller extends Controller { // We don't need to save the session for this request Session::abort_save(); + expires::set(2592000); // 30 days + // Dump out the image. If the item is a movie, then its thumbnail will be a JPG. if ($item->is_movie() && $type != "albums") { header("Content-type: image/jpeg"); -- cgit v1.2.3 From 399c5c21f6da5dc02e55be6d5b453b43ae4cf158 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Dec 2009 11:47:34 -0800 Subject: Force the 'Select Photos...' button to always be in the center of the upload dialog with the flash object overtop of it. Fixes ticket: #908. --- modules/gallery/views/form_uploadify.html.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index d856c464..43b73033 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -1,15 +1,19 @@ @@ -23,7 +27,6 @@ fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4", fileDesc: for_js() ?>, cancelImg: "", - buttonText: for_js() ?>, simUploadLimit: , wmode: "transparent", hideButton: true, /* should be true */ @@ -77,7 +80,6 @@ $("#g-add-photos-status ul").append( "
  • " + fileObj.name + msg + "
  • "); $("#g-uploadify" + queueID).remove(); - //return false; }, onSelect: function(event) { if ($("#g-upload-cancel-all").hasClass("ui-state-disabled")) { @@ -114,7 +116,7 @@
    - +
    -- cgit v1.2.3 From 7af844606d79d1f987c6d754f5c5db64d86acc47 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Dec 2009 15:33:22 -0800 Subject: The problem occurs because the square brackets are treated as special characters in the glob to find the children. This patch escapes the square brackets. Fixes ticket #855 --- modules/server_add/controllers/server_add.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 6ff00812..f6e3a4dd 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -42,13 +42,15 @@ class Server_Add_Controller extends Admin_Controller { // Make a tree with the parents back up to the authorized path, and all the children under the // current path. + Kohana_Log::add("error", $path); if (server_add::is_valid_path($path)) { $tree->parents[] = $path; while (server_add::is_valid_path(dirname($tree->parents[0]))) { array_unshift($tree->parents, dirname($tree->parents[0])); } - foreach (glob("$path/*") as $file) { + $glob_path = str_replace(array("{", "}", "[", "]"), array("\{", "\}", "\[", "\]"), $path); + foreach (glob("$glob_path/*") as $file) { if (!is_readable($file)) { continue; } -- cgit v1.2.3