Merge branch 'dev' into 'dev'
provide auto redirect from zot6 /item permalinks See merge request hubzilla/core!1684
This commit is contained in:
commit
40bbdfdf6a
@ -193,6 +193,25 @@ class Item extends Controller {
|
|||||||
killme();
|
killme();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(argc() > 1 && argv(1) !== 'drop') {
|
||||||
|
$x = q("select uid, item_wall, llink, mid from item where mid = '%s' ",
|
||||||
|
dbesc(z_root() . '/item/' . argv(1))
|
||||||
|
);
|
||||||
|
if($x) {
|
||||||
|
foreach($x as $xv) {
|
||||||
|
if (intval($xv['item_wall'])) {
|
||||||
|
$c = channelx_by_n($xv['uid']);
|
||||||
|
if ($c) {
|
||||||
|
goaway($c['xchan_url'] . '?mid=' . gen_link_id($xv['mid']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
goaway($x[0]['llink']);
|
||||||
|
}
|
||||||
|
http_status_exit(404, 'Not found');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,11 +96,15 @@ function api_login(&$a){
|
|||||||
if($sigblock) {
|
if($sigblock) {
|
||||||
$keyId = str_replace('acct:','',$sigblock['keyId']);
|
$keyId = str_replace('acct:','',$sigblock['keyId']);
|
||||||
if($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)
|
dbesc($keyId)
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
$c = channelx_by_hash($r[0]['hubloc_hash']);
|
$c = channelx_by_hash($r[0]['hubloc_hash']);
|
||||||
|
if (! $c) {
|
||||||
|
$c = channelx_by_portid($r[0]['hubloc_hash']);
|
||||||
|
}
|
||||||
if($c) {
|
if($c) {
|
||||||
$a = q("select * from account where account_id = %d limit 1",
|
$a = q("select * from account where account_id = %d limit 1",
|
||||||
intval($c['channel_account_id'])
|
intval($c['channel_account_id'])
|
||||||
|
Reference in New Issue
Block a user