UPDATE_OSTATUS_PROFILES;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
/*
* Hacky class to remove some checks and get public access to
// @fixme this should be better encapsulated
// ripped from oauthstore.php (for old OMB client)
- $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+ $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
try {
if (!copy($url, $temp_filename)) {
// TRANS: Server exception. %s is a URL.
- throw new ServerException(sprintf(_m('Unable to fetch avatar from %s.'), $url));
+ throw new ServerException(sprintf(_m('Unable to fetch avatar from %s to %s.'), $url, $temp_filename));
}
if ($this->isGroup()) {
* @throws Exception on various error conditions
* @throws OStatusShadowException if this reference would obscure a local user/group
*/
- public static function updateProfileURL($profile_url, $hints=array())
+ public static function updateProfileURL($profile_url, array $hints=array())
{
$oprofile = null;
$hints = array('webfinger' => $addr);
- $dhints = DiscoveryHints::fromXRD($xrd);
-
- $hints = array_merge($hints, $dhints);
+ try {
+ $dHints = DiscoveryHints::fromXRD($xrd);
+ $hints = array_merge($hints, $xrdHints);
+ } catch (Exception $e) {
+ // No hints available from XRD
+ }
// If there's an Hcard, let's grab its info
if (array_key_exists('hcard', $hints)) {