From fb182d6142a4475366e7315812a35cbee4e094ee Mon Sep 17 00:00:00 2001 From: Devender Singh Date: Mon, 9 Jan 2012 16:34:40 +0530 Subject: [PATCH] Committed addlistitem.php after including json_encode function so as slashes and quotes could be handled automatically --- library/ajax/addlistitem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/ajax/addlistitem.php b/library/ajax/addlistitem.php index bc9df9a40..4a47afbc0 100644 --- a/library/ajax/addlistitem.php +++ b/library/ajax/addlistitem.php @@ -32,8 +32,8 @@ $exists_title = sqlQuery("SELECT * FROM list_options WHERE ". " list_id='".$list_id."'". " and title='".trim($title). "'" ); -if ($exists_title) { - echo '{"error":"' . addslashes( xl('Record already exist')) . '"}'; +if ($exists_title) { + echo json_encode(array("error"=> xl('Record already exist') )); exit; } @@ -42,7 +42,7 @@ $exists_id = sqlQuery("SELECT * FROM list_options WHERE ". " and option_id='".trim($option_id)."'" ); if ($exists_id) { - echo '{"error":"' . addslashes( xl('Record already exist')) . '"}'; + echo json_encode(array("error"=> xl('Record already exist') )); exit; } -- 2.11.4.GIT