summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-07-11 06:24:10 -0700
committerBharat Mediratta <bharat@menalto.com>2009-07-11 06:24:10 -0700
commit4d0099e7165a4a1508eea58613cdc75e116464ff (patch)
treea7c919d3f649156aa8274a40225dccb21efcea0f
parent6b013060aabc1d13545958fdb3c096faac2ba5a7 (diff)
Fix a bug where we're referring to $photo when we just uploaded a
$movie, that causes the simpler uploader to throw an error for all movies.
-rw-r--r--modules/gallery/controllers/simple_uploader.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php
index a059f986..75a7b810 100644
--- a/modules/gallery/controllers/simple_uploader.php
+++ b/modules/gallery/controllers/simple_uploader.php
@@ -58,13 +58,13 @@ class Simple_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"))) {
- $movie = movie::create($album, $temp_filename, $name, $title);
+ $item = movie::create($album, $temp_filename, $name, $title);
log::success("content", t("Added a movie"),
- html::anchor("movies/$movie->id", t("view movie")));
+ html::anchor("movies/$item->id", t("view movie")));
} else {
- $photo = photo::create($album, $temp_filename, $name, $title);
+ $item = photo::create($album, $temp_filename, $name, $title);
log::success("content", t("Added a photo"),
- html::anchor("photos/$photo->id", t("view photo")));
+ html::anchor("photos/$item->id", t("view photo")));
}
} catch (Exception $e) {
Kohana::log("alert", $e->__toString());
@@ -76,7 +76,7 @@ class Simple_Uploader_Controller extends Controller {
return;
}
unlink($temp_filename);
- print "FILEID: $photo->id";
+ print "FILEID: $item->id";
} else {
header("HTTP/1.1 400 Bad Request");
print "ERROR: Invalid Upload";