returnJson 동작 방식 일부 수정
This commit is contained in:
+11
-5
@@ -132,15 +132,21 @@ function Error($message, $url="") {
|
||||
exit;
|
||||
}
|
||||
|
||||
function returnJson($value, $noCache = true, $pretty = false, $die = true){
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if($noCache){
|
||||
header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
|
||||
function SetHeaderNoCache(){
|
||||
if(!headers_sent()) {
|
||||
header('Expires: Wed, 01 Jan 2014 00:00:00 GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
}
|
||||
|
||||
function returnJson($value, $noCache = true, $pretty = false, $die = true){
|
||||
if($noCache){
|
||||
SetHeaderNoCache();
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if($pretty){
|
||||
$flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
|
||||
|
||||
Reference in New Issue
Block a user