Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

function returnErro...
 
Notifications
Clear all

function returnError in api/index.php returns invalid JSON

2 Posts
2 Users
0 Reactions
1,766 Views
(@wolfmanx)
Posts: 1
New Member
Topic starter
 
[#6433]

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;
}

 
Posted : 07 Jan 2020 4H43
(@babynus)
Posts: 14952
Member Admin
 

You're right !
Fix will be included in next patch

Thanks for pointing out the issue and proposing a fix.


 
Posted : 07 Jan 2020 11H44
Share:

Scroll to Top