ProjeQtOr free project management software - function returnError in api/index.php returns invalid JSON - ProjeQtOr
 

function returnError in api/index.php returns invalid JSON

More
07 Jan 2020 02:43 #1 by wolfmanx
The function:returnError in file api/index.php
function returnError($error, $message) {
	echo '{"error":"'.$error.'", "message":"'.$message.'"}';
	exit;
}

returns invalid JSON without escaping NEWLINES.

A quick fix is:
function returnError($error, $message) {
    echo '{"error":'.json_encode($error).', "message": '.json_encode($message).'}';
    exit;
}

Please Connexion or Create an account to join the conversation.

More
07 Jan 2020 09:44 #2 by babynus
You're right !
Fix will be included in next patch

Thanks for pointing out the issue and proposing a fix.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.028 seconds