use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
&& is_array($_SESSION['remote']))
{
foreach ($_SESSION['remote'] as $v) {
- if (!empty($v['uid']) && !empty($_SESSION['visitor_visiting']) &&
- !empty($v['cid']) && !empty($_SESSION['visitor_id']) &&
- $v['uid'] == $_SESSION['visitor_visiting'] &&
- $v['cid'] == $_SESSION['visitor_id']) {
+ if (!empty($v['uid']) && !empty($v['cid']) &&
+ $v['uid'] == Session::get('visitor_visiting') &&
+ $v['cid'] == Session::get('visitor_id')) {
// Remote user is already authenticated.
$target_url = defaults($url, $contact_url);
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG);
// When the remote page does support OWA, then we enforce the use of it
$basepath = Contact::getBasepath($contact_url);
- if ($basepath == System::baseUrl()) {
+ if (Strings::compareLink($basepath, System::baseUrl())) {
$use_magic = true;
} else {
$serverret = Network::curl($basepath . '/magic');