From 6b1fa6217355a8458a84791ce02e2bb0067b1da2 Mon Sep 17 00:00:00 2001 From: Felix Rabinovich Date: Fri, 26 Dec 2008 20:08:15 +0000 Subject: Added content type to JSON output functions --- core/controllers/albums.php | 3 +++ core/controllers/photos.php | 1 + 2 files changed, 4 insertions(+) (limited to 'core') diff --git a/core/controllers/albums.php b/core/controllers/albums.php index 61d6ad22..948eda12 100644 --- a/core/controllers/albums.php +++ b/core/controllers/albums.php @@ -70,6 +70,7 @@ class Albums_Controller extends Items_Controller { private function _create_album($album) { access::required("edit", $album); + rest::http_content_type(rest::JSON); $form = album::get_add_form($album); if ($form->validate()) { $new_album = album::create( @@ -97,6 +98,7 @@ class Albums_Controller extends Items_Controller { private function _create_photo($album) { access::required("edit", $album); + rest::http_content_type(rest::JSON); $form = photo::get_add_form($album); if ($form->validate()) { $photo = photo::create( @@ -128,6 +130,7 @@ class Albums_Controller extends Items_Controller { public function _update($album) { access::required("edit", $album); + rest::http_content_type(rest::JSON); $form = album::get_edit_form($album); if ($form->validate()) { // @todo implement changing the name. This is not trivial, we have diff --git a/core/controllers/photos.php b/core/controllers/photos.php index 13185283..9ceaa5c9 100644 --- a/core/controllers/photos.php +++ b/core/controllers/photos.php @@ -45,6 +45,7 @@ class Photos_Controller extends Items_Controller { public function _update($photo) { access::required("edit", $photo); + rest::http_content_type(rest::JSON); $form = photo::get_edit_form($photo); if ($form->validate()) { // @todo implement changing the name. This is not trivial, we have -- cgit v1.2.3