aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-05-19 21:20:57 -0700
committerfriendica <info@friendica.com>2013-05-19 21:20:57 -0700
commit92ecc6fe43dc38e91c6a4dcb1529698039649387 (patch)
tree3f2673e1571a462a64b167f9df5d893086ffebf5
parent52acfce84b4c53ed01e7a37da05d0395bbceeeff (diff)
downloadvolse-hubzilla-92ecc6fe43dc38e91c6a4dcb1529698039649387.tar.gz
volse-hubzilla-92ecc6fe43dc38e91c6a4dcb1529698039649387.tar.bz2
volse-hubzilla-92ecc6fe43dc38e91c6a4dcb1529698039649387.zip
fix magic auth against orphaned duplicated hublocs
-rw-r--r--mod/magic.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/mod/magic.php b/mod/magic.php
index e655e9737..a0aa4aad4 100644
--- a/mod/magic.php
+++ b/mod/magic.php
@@ -10,14 +10,14 @@ function magic_init(&$a) {
if($hash) {
$x = q("select xchan.xchan_url, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash
- where hubloc_hash = '%s' and (hubloc_flags & %d) limit 1",
+ where hubloc_hash = '%s' and (hubloc_flags & %d) order by hubloc_id desc limit 1",
dbesc($hash),
intval(HUBLOC_FLAGS_PRIMARY)
);
}
elseif($addr) {
$x = q("select hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash
- where xchan_addr = '%s' and (hubloc_flags & %d) limit 1",
+ where xchan_addr = '%s' and (hubloc_flags & %d) order by hubloc_id desc limit 1",
dbesc($addr),
intval(HUBLOC_FLAGS_PRIMARY)
);
@@ -29,7 +29,7 @@ function magic_init(&$a) {
$u = $b[0] . '//' . $b[2];
$x = q("select xchan.xchan_url, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash
- where hubloc_url = '%s' limit 1",
+ where hubloc_url = '%s' order by hubloc_id desc limit 1",
dbesc($u)
);
@@ -46,7 +46,7 @@ function magic_init(&$a) {
if($j)
import_xchan($j);
$x = q("select hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash
- where xchan_addr = '%s' and (hubloc_flags & %d) limit 1",
+ where xchan_addr = '%s' and (hubloc_flags & %d) order by hubloc_id desc limit 1",
dbesc($addr),
intval(HUBLOC_FLAGS_PRIMARY)
);