Merge branch 'dev' into 'dev'

provide auto redirect from zot6 /item permalinks

See merge request hubzilla/core!1684
This commit is contained in:
Mario
2019-06-26 09:21:22 +02:00
2 changed files with 24 additions and 1 deletions

View File

@@ -96,11 +96,15 @@ function api_login(&$a){
if($sigblock) {
$keyId = str_replace('acct:','',$sigblock['keyId']);
if($keyId) {
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
$r = q("select * from hubloc where ( hubloc_addr = '%s' or hubloc_id_url = '%s' ) limit 1",
dbesc($keyId),
dbesc($keyId)
);
if($r) {
$c = channelx_by_hash($r[0]['hubloc_hash']);
if (! $c) {
$c = channelx_by_portid($r[0]['hubloc_hash']);
}
if($c) {
$a = q("select * from account where account_id = %d limit 1",
intval($c['channel_account_id'])