aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Rmagic.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-11-05 08:46:42 +0000
committerMario <mario@mariovavti.com>2020-11-05 08:46:42 +0000
commitbafbf0416462c6f18c3fb6c8c06a063c8d6fdae6 (patch)
tree8929845be585b09d0f420621281c5531e1efad3e /Zotlabs/Module/Rmagic.php
parent6f93d9848c43019d43ea76c27d42d657ba031cd7 (diff)
parentfdefa101d84dc2a9424eaedbdb003a4c30ec5d01 (diff)
downloadvolse-hubzilla-bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6.tar.gz
volse-hubzilla-bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6.tar.bz2
volse-hubzilla-bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6.zip
Merge branch '5.0RC'5.0
Diffstat (limited to 'Zotlabs/Module/Rmagic.php')
-rw-r--r--Zotlabs/Module/Rmagic.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/Zotlabs/Module/Rmagic.php b/Zotlabs/Module/Rmagic.php
index 8c1e5cdab..ab9ad059e 100644
--- a/Zotlabs/Module/Rmagic.php
+++ b/Zotlabs/Module/Rmagic.php
@@ -1,6 +1,7 @@
<?php
namespace Zotlabs\Module;
+use Zotlabs\Lib\Libzot;
class Rmagic extends \Zotlabs\Web\Controller {
@@ -11,23 +12,24 @@ class Rmagic extends \Zotlabs\Web\Controller {
$me = get_my_address();
if($me) {
- $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
+ $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'",
dbesc($me)
);
if(! $r) {
$w = discover_by_webbie($me);
if($w) {
- $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
+ $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'",
dbesc($me)
);
}
}
- if($r) {
- if($r[0]['hubloc_url'] === z_root())
+ if($r) {
+ $r = Libzot::zot_record_preferred($r);
+ if($r['hubloc_url'] === z_root())
goaway(z_root() . '/login');
$dest = bin2hex(z_root() . '/' . str_replace(['rmagic','zid='],['','zid_='],\App::$query_string));
- goaway($r[0]['hubloc_url'] . '/magic' . '?f=&owa=1&bdest=' . $dest);
+ goaway($r['hubloc_url'] . '/magic' . '?f=&owa=1&bdest=' . $dest);
}
}
}
@@ -55,13 +57,13 @@ class Rmagic extends \Zotlabs\Web\Controller {
$r = null;
if($address) {
- $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
+ $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'",
dbesc($address)
);
if(! $r) {
$w = discover_by_webbie($address);
if($w) {
- $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
+ $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'",
dbesc($address)
);
}
@@ -69,7 +71,8 @@ class Rmagic extends \Zotlabs\Web\Controller {
}
if($r) {
- $url = $r[0]['hubloc_url'];
+ $r = Libzot::zot_record_preferred($r);
+ $url = $r['hubloc_url'];
}
else {
$url = 'https://' . substr($address,strpos($address,'@')+1);