Fix issue.

This commit is contained in:
Pierre HUBERT 2018-08-26 14:58:01 +02:00
parent e1760dd772
commit 9a4048af4b

View File

@ -113,6 +113,10 @@ class friendsController{
//Get target ID
$friendID = getPostUserID('friendID');
//Check if the current user is requesting himself as friend
if($friendID == userID)
Rest_fatal_error(401, "You can not become a friend to yourself!");
//Check if the two persons are already friend
if(CS::get()->components->friends->are_friend(userID, $friendID))
Rest_fatal_error(401, "The two personns are already friend !");