use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
-use Friendica\Util\Network;
use Friendica\Util\Strings;
function redir_init(App $a) {
System::externalRedirect($contact['poll'] . '?dfrn_id=' . $dfrn_id
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest . $quiet);
-
- redir_check_url($contact_url, $url);
- $url = $url ?: $contact_url;
}
if (empty($url)) {
- throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
+ throw new \Friendica\Network\HTTPException\BadRequestException(DI::l10n()->t('Bad Request.'));
}
// If we don't have a connected contact, redirect with
}
// Test for magic auth on the target system
- $serverret = Network::curl($basepath . '/magic');
+ $serverret = DI::httpRequest()->get($basepath . '/magic');
if ($serverret->isSuccess()) {
$separator = strpos($target_url, '?') ? '&' : '?';
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
}
$url_host = parse_url($url, PHP_URL_HOST);
+ if (empty($url_host)) {
+ $url_host = parse_url(DI::baseUrl(), PHP_URL_HOST);
+ }
+
$contact_url_host = parse_url($contact_url, PHP_URL_HOST);
if ($url_host == $contact_url_host) {