From 8c06908f7f4e0bf6d55d4f6e2ee2c062b2f8190e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 20 Nov 2008 17:51:12 +0000 Subject: [PATCH] Use rest::http_content_type() instead of the header() method to set response content --- modules/comment/helpers/comment.php | 4 ++-- modules/media_rss/controllers/media_rss.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index 2d25df3f..8462159b 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -118,12 +118,12 @@ class Comment_Core { switch (rest::output_format()) { case "xml": - header("Content-Type: application/xml"); + rest::http_content_type(rest::XML); return xml::to_xml($comments, array("comments", "comment")); break; case "json": - header("Content-Type: application/json"); + rest::http_content_type(rest::JSON); foreach ($comments as $comment) { $data[] = $comment->as_array(); } diff --git a/modules/media_rss/controllers/media_rss.php b/modules/media_rss/controllers/media_rss.php index 10d9741b..1ec90766 100644 --- a/modules/media_rss/controllers/media_rss.php +++ b/modules/media_rss/controllers/media_rss.php @@ -48,7 +48,7 @@ class Media_RSS_Controller extends Controller { // @todo do we want to add an upload date to the items table? $view->pub_date = date("D, d M Y H:i:s T"); - header("Content-type: application/rss+xml"); + rest::http_content_type(rest::RSS); print $view; } } \ No newline at end of file