1
0
Fork 0

Alternate fix for issue 4069

This commit is contained in:
Michael 2017-12-17 11:11:28 +00:00
parent dc7bff0235
commit 3c835ccb22

View file

@ -470,12 +470,12 @@ function api_rss_extra(App $a, $arr, $user_info)
* @return bool|string
* Contact url or False if contact id is unknown
*/
function api_unique_id_to_url($id)
function api_unique_id_to_nurl($id)
{
$r = dba::select('contact', array('url'), array('uid' => 0, 'id' => $id), array('limit' => 1));
$r = dba::select('contact', array('nurl'), array('uid' => 0, 'id' => $id), array('limit' => 1));
if (DBM::is_result($r)) {
return $r["url"];
return $r["nurl"];
} else {
return false;
}
@ -511,7 +511,7 @@ function api_get_user(App $a, $contact_id = null, $type = "json")
// Searching for contact id with uid = 0
if (!is_null($contact_id) && (intval($contact_id) != 0)) {
$user = dbesc(api_unique_id_to_url($contact_id));
$user = dbesc(api_unique_id_to_nurl($contact_id));
if ($user == "") {
throw new BadRequestException("User not found.");
@ -525,7 +525,7 @@ function api_get_user(App $a, $contact_id = null, $type = "json")
}
if (is_null($user) && x($_GET, 'user_id')) {
$user = dbesc(api_unique_id_to_url($_GET['user_id']));
$user = dbesc(api_unique_id_to_nurl($_GET['user_id']));
if ($user == "") {
throw new BadRequestException("User not found.");
@ -559,7 +559,7 @@ function api_get_user(App $a, $contact_id = null, $type = "json")
$argid = count($called_api);
list($user, $null) = explode(".", $a->argv[$argid]);
if (is_numeric($user)) {
$user = dbesc(api_unique_id_to_url($user));
$user = dbesc(api_unique_id_to_nurl($user));
if ($user == "") {
return false;