Created
March 15, 2013 13:38
-
-
Save MissAllSunday/5169914 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function returnResponse() | |
{ | |
global $modSettings; | |
// kill anything else | |
ob_end_clean(); | |
if (!empty($modSettings['enableCompressedOutput'])) | |
@ob_start('ob_gzhandler'); | |
else | |
ob_start(); | |
// Send the header | |
header('Content-Type: application/json'); | |
// Is there a custom message? Use it | |
if (!empty($this->_response)) | |
print json_encode($this->_response); | |
// No? then show the standard error message | |
else | |
print json_encode(array( | |
'data' => $this->_text->getText('error_message'), | |
'type' => 'error' | |
)); | |
// Done | |
obExit(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment