mirror of
https://github.com/Pathduck/gallery3.git
synced 2024-10-29 21:07:18 -04:00
Use rest::http_content_type() instead of the header() method to set response content
This commit is contained in:
parent
b78cee6395
commit
8c06908f7f
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user