remove error log spam

This commit is contained in:
Hannes Mannerheim 2014-11-25 02:34:49 +01:00
parent 019fdbd8c9
commit c6c5a28959

View File

@ -76,12 +76,10 @@ class ApiExternalUserShowAction extends ApiPrivateAuthAction
// if profile url is not ending with nickname, this is probably a single user instance // if profile url is not ending with nickname, this is probably a single user instance
if(!substr($profileurl, -strlen($username))===$username) { if(!substr($profileurl, -strlen($username))===$username) {
$instanceurl = $profileurl; $instanceurl = $profileurl;
error_log('1');
} }
// multi user instance // multi user instance
else { else {
error_log('2');
$instanceurl = substr($profileurl, 0, strrpos($profileurl, '/')); $instanceurl = substr($profileurl, 0, strrpos($profileurl, '/'));
} }
@ -94,21 +92,18 @@ class ApiExternalUserShowAction extends ApiPrivateAuthAction
if(substr($profileurl, -1)==='/') { if(substr($profileurl, -1)==='/') {
$instanceurl = $profileurl; $instanceurl = $profileurl;
$username = 1; $username = 1;
error_log('3');
} }
// multi user instance // multi user instance
else { else {
$username = substr($profileurl, strrpos($profileurl, '/')+1); $username = substr($profileurl, strrpos($profileurl, '/')+1);
$instanceurl = substr($profileurl, 0, strrpos($profileurl, '/')); $instanceurl = substr($profileurl, 0, strrpos($profileurl, '/'));
error_log('4');
} }
} }
// get profile from external instance // get profile from external instance
$apicall = $instanceurl.'/api/users/show.json?id='.$username; $apicall = $instanceurl.'/api/users/show.json?id='.$username;
error_log('apicall:'.$apicall);
stream_context_set_default(array('http' => array('method' => 'GET'))); stream_context_set_default(array('http' => array('method' => 'GET')));
$this->profile->external = json_decode(file_get_contents($apicall)); $this->profile->external = json_decode(file_get_contents($apicall));