summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/file_proxy.php4
-rw-r--r--modules/gallery/controllers/uploader.php2
-rw-r--r--modules/gallery/helpers/item.php7
3 files changed, 10 insertions, 3 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 49aa9c5a..b9ff7df1 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -68,10 +68,10 @@ class File_Proxy_Controller extends Controller {
$item = item::find_by_path($path);
if (!$item->loaded()) {
// We didn't turn it up. If we're looking for a .jpg then it's it's possible that we're
- // requesting the thumbnail for a movie. In that case, the .flv, .mp4 or .m4v file would
+ // requesting the thumbnail for a movie. In that case, the movie file would
// have been converted to a .jpg. So try some alternate types:
if (preg_match('/.jpg$/', $path)) {
- foreach (array("flv", "mp4", "m4v") as $ext) {
+ foreach (legal_file::get_movie_extensions() as $ext) {
$movie_path = preg_replace('/.jpg$/', ".$ext", $path);
$item = item::find_by_path($movie_path);
if ($item->loaded()) {
diff --git a/modules/gallery/controllers/uploader.php b/modules/gallery/controllers/uploader.php
index 4ea55ff6..ecb0ca89 100644
--- a/modules/gallery/controllers/uploader.php
+++ b/modules/gallery/controllers/uploader.php
@@ -69,7 +69,7 @@ class Uploader_Controller extends Controller {
$path_info = @pathinfo($temp_filename);
if (array_key_exists("extension", $path_info) &&
- in_array(strtolower($path_info["extension"]), array("flv", "mp4", "m4v"))) {
+ in_array(strtolower($path_info["extension"]), legal_file::get_movie_extensions())) {
$item->type = "movie";
$item->save();
log::success("content", t("Added a movie"),
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index d8b660d9..b739e8bd 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -415,6 +415,13 @@ class item_Core {
}
/**
+ * Get rid of the display context callback
+ */
+ static function clear_display_context_callback() {
+ Cache::instance()->delete("display_context_" . $sid = Session::instance()->id());
+ }
+
+ /**
* Call the display context callback for the given item
*/
static function get_display_context($item) {