diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment/controllers/comments.php | 14 | ||||
-rw-r--r-- | modules/gallery/helpers/l10n_client.php | 2 | ||||
-rw-r--r-- | modules/organize/controllers/organize.php | 5 | ||||
-rw-r--r-- | modules/tag/controllers/admin_tags.php | 2 |
4 files changed, 16 insertions, 7 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index c48bd380..99ecc8e0 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -37,13 +37,17 @@ class Comments_Controller extends REST_Controller { switch (rest::output_format()) { case "json": foreach ($comments as $comment) { - $data[] = $comment->as_array(); + $data[] = array( + "id" => $comment->id, + "author_name" => p::clean($comment->author_name()), + "created" => $comment->created, + "text" => p::clean($comment->text)); } print json_encode($data); break; case "html": - $view = new View("comments.html"); + $view = new Theme_View("comments.html", "page"); $view->comments = $comments; print $view; break; @@ -120,7 +124,11 @@ class Comments_Controller extends REST_Controller { if (rest::output_format() == "json") { print json_encode( array("result" => "success", - "data" => $comment->as_array())); + "data" => array( + "id" => $comment->id, + "author_name" => p::clean($comment->author_name()), + "created" => $comment->created, + "text" => p::clean($comment->text)))); } else { $view = new Theme_View("comment.html", "fragment"); $view->comment = $comment; diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php index 4e905c6c..33f23857 100644 --- a/modules/gallery/helpers/l10n_client.php +++ b/modules/gallery/helpers/l10n_client.php @@ -173,7 +173,7 @@ class l10n_client_Core { $request->{$key}->translations->{$row->locale} = json_encode(unserialize($row->translation)); } - // @todo reduce memory consumpotion, e.g. free $request + // @todo reduce memory consumption, e.g. free $request $request_data = json_encode($request); $url = self::_server_url() . "?q=translations/submit"; $signature = self::_sign($request_data); diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 43d41357..57709cb5 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -61,8 +61,9 @@ class Organize_Controller extends Controller { access::required("view", $item); access::required("edit", $item); - print json_encode(array("title" => $item->title, - "description" => empty($item->description) ? "" : $item->description)); + print json_encode( + array("title" => p::clean($item->title), + "description" => empty($item->description) ? "" : p::clean($item->description))); } function tree($item, $parent) { diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php index 01884bb8..af5055ff 100644 --- a/modules/tag/controllers/admin_tags.php +++ b/modules/tag/controllers/admin_tags.php @@ -106,7 +106,7 @@ class Admin_Tags_Controller extends Admin_Controller { array("result" => "success", "location" => url::site("admin/tags"), "tag_id" => $tag->id, - "new_tagname" => $tag->name)); + "new_tagname" => p::clean($tag->name))); } else { print json_encode( array("result" => "error", |