diff --git a/ext/chatbox/cp/ajax.php b/ext/chatbox/cp/ajax.php index 8abc43f0..f682649f 100644 --- a/ext/chatbox/cp/ajax.php +++ b/ext/chatbox/cp/ajax.php @@ -4,7 +4,6 @@ $kioskMode = false; include '../php/filestorage.class.php'; include '../preferences.php'; -include '../php/json.class.php'; include '../php/functions.php'; include '../php/yshout.class.php'; include '../php/ajaxcall.class.php'; @@ -41,7 +40,7 @@ function doLogin() { 'html' => cp() ); - echo jsonEncode($result); + echo json_encode($result); return; } @@ -53,7 +52,7 @@ function doLogin() { } else $result['error'] = 'invalid'; - echo jsonEncode($result); + echo json_encode($result); } function doLogout() { @@ -63,7 +62,7 @@ function doLogout() { 'error' => false ); - echo jsonEncode($result); + echo json_encode($result); } function doUnban() { @@ -74,7 +73,7 @@ function doUnban() { 'error' => false ); - echo jsonEncode($result); + echo json_encode($result); return; } @@ -92,7 +91,7 @@ function doUnban() { $result['error'] = 'notbanned'; - echo jsonEncode($result); + echo json_encode($result); } function doUnbanAll() { @@ -103,7 +102,7 @@ function doUnbanAll() { 'error' => false ); - echo jsonEncode($result); + echo json_encode($result); return; } @@ -116,7 +115,7 @@ function doUnbanAll() { 'error' => false ); - echo jsonEncode($result); + echo json_encode($result); } @@ -128,7 +127,7 @@ function doSetPreference() { 'error' => false ); - echo jsonEncode($result); + echo json_encode($result); return; } @@ -150,7 +149,7 @@ function doSetPreference() { 'error' => false ); - echo jsonEncode($result); + echo json_encode($result); } @@ -162,7 +161,7 @@ function doResetPreferences() { 'error' => false ); - echo jsonEncode($result); + echo json_encode($result); return; } @@ -177,7 +176,7 @@ function doResetPreferences() { 'prefs' => $prefs ); - echo jsonEncode($result); + echo json_encode($result); } /* CP Display */ @@ -456,4 +455,3 @@ function about() { return $html; } -?> \ No newline at end of file diff --git a/ext/chatbox/history/index.php b/ext/chatbox/history/index.php index aadd2853..4a9a8b04 100644 --- a/ext/chatbox/history/index.php +++ b/ext/chatbox/history/index.php @@ -3,7 +3,6 @@ include '../php/filestorage.class.php'; include '../preferences.php'; - include '../php/json.class.php'; include '../php/functions.php'; include '../php/yshout.class.php'; diff --git a/ext/chatbox/include.php b/ext/chatbox/include.php index b26589a4..a3d4b7b7 100644 --- a/ext/chatbox/include.php +++ b/ext/chatbox/include.php @@ -2,9 +2,7 @@ $null = null; include 'php/filestorage.class.php'; include 'preferences.php'; - include 'php/json.class.php'; include 'php/functions.php'; include 'php/yshout.class.php'; include 'php/ajaxcall.class.php'; - -?> \ No newline at end of file + diff --git a/ext/chatbox/php/ajaxcall.class.php b/ext/chatbox/php/ajaxcall.class.php index 149a2ecc..78107e09 100644 --- a/ext/chatbox/php/ajaxcall.class.php +++ b/ext/chatbox/php/ajaxcall.class.php @@ -95,7 +95,7 @@ $send['error'] = false; } - echo jsonEncode($send); + echo json_encode($send); } function doUnban() { @@ -115,7 +115,7 @@ $send['error'] = false; } - echo jsonEncode($send); + echo json_encode($send); } function doDelete() { @@ -132,7 +132,7 @@ $send['error'] = false; } - echo jsonEncode($send); + echo json_encode($send); } function banSelf() { @@ -143,7 +143,7 @@ $send = array(); $send['error'] = false; - echo jsonEncode($send); + echo json_encode($send); } function unbanSelf() { @@ -158,7 +158,7 @@ $send['error'] = 'admin'; } - echo jsonEncode($send); + echo json_encode($send); } function reload() { @@ -168,7 +168,7 @@ $posts = $ys->latestPosts($prefs['truncate']); $this->setSessTimestamp($posts); $this->updates['posts'] = $posts; - echo jsonEncode($this->updates); + echo json_encode($this->updates); } function initSession() { @@ -186,7 +186,7 @@ 'banned' => true ); - echo jsonEncode($this->updates); + echo json_encode($this->updates); } function sendUpdates() { @@ -199,7 +199,7 @@ $this->updates['posts'] = $posts; - echo jsonEncode($this->updates); + echo json_encode($this->updates); } function setSessTimestamp(&$posts) { @@ -231,7 +231,7 @@ if ($ys->banned(ip())) $this->updates['banned'] = true; - echo jsonEncode($this->updates); + echo json_encode($this->updates); } function cleanPrefs($prefs) { @@ -253,7 +253,7 @@ $send['error'] = false; } - echo jsonEncode($send); + echo json_encode($send); } function clearLogs() { @@ -277,7 +277,7 @@ $send['error'] = false; } - echo jsonEncode($send); + echo json_encode($send); } } diff --git a/ext/chatbox/php/functions.php b/ext/chatbox/php/functions.php index c61a65e3..2966ce7d 100644 --- a/ext/chatbox/php/functions.php +++ b/ext/chatbox/php/functions.php @@ -45,19 +45,6 @@ return false; } - function jsonEncode(&$array) { - if ($array) { - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - return $json->encode($array); - } else - return 'ar'; - } - - function jsonDecode($encoded) { - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - return $json->decode($encoded); - } - function validIP($ip) { if ($ip == long2ip(ip2long($ip))) return true; diff --git a/ext/chatbox/php/yshout.class.php b/ext/chatbox/php/yshout.class.php index e0074cba..e3b3f02b 100644 --- a/ext/chatbox/php/yshout.class.php +++ b/ext/chatbox/php/yshout.class.php @@ -246,7 +246,6 @@ class YShout { } } } - } diff --git a/ext/chatbox/yshout.php b/ext/chatbox/yshout.php index edb35f55..0994309f 100644 --- a/ext/chatbox/yshout.php +++ b/ext/chatbox/yshout.php @@ -1,8 +1,10 @@ "$str. \n File: $file \n Line: $line" ); - if (function_exists('jsonEncode')) - echo jsonEncode($err); - else - echo $err['yError']; + echo json_encode($err); + exit; } -?> \ No newline at end of file