From fa6ac399bed51fb37470a697cf440311f689aad2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 2 Mar 2020 17:21:58 -0500 Subject: [PATCH] Fix code in makePopupLink. Return content-type application/json for json response --- web/includes/functions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index c24b4cf5e..aec5d12b9 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -436,8 +436,9 @@ function makeLink($url, $label, $condition=1, $options='') { */ function makePopupLink($url, $winName, $winSize, $label, $condition=1, $options='') { // Avoid double-encoding since some consumers incorrectly pass a pre-escaped URL. + $string = ''; } else { - $string .= ''; + $string .= '>'; } $string .= $label; $string .= ''; @@ -2186,7 +2187,8 @@ function ajaxError($message, $code=HTTP_STATUS_OK) { ajaxCleanup(); if ( $code == HTTP_STATUS_OK ) { $response = array('result'=>'Error', 'message'=>$message); - header('Content-type: text/plain'); + header('Content-type: application/json'); + #header('Content-type: text/plain'); exit(jsonEncode($response)); } header("HTTP/1.0 $code $message"); @@ -2202,7 +2204,8 @@ function ajaxResponse($result=false) { } else if ( !empty($result) ) { $response['message'] = $result; } - header('Content-type: text/plain'); + header('Content-type: application/json'); + #header('Content-type: text/plain'); exit(jsonEncode($response)); }