diff options
author | Mario <mario@mariovavti.com> | 2019-06-26 09:21:22 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-06-26 09:21:22 +0200 |
commit | 40bbdfdf6ac53b04d723881d91f8ea12999d97af (patch) | |
tree | 40b7386ba354c8d0eadceee1e0dd9399a395cf27 /Zotlabs/Module | |
parent | ad8ad0ccd78db4f33c308a183809883cd4002a5c (diff) | |
parent | 4f280b5497325c7e7389096cb39f1f409de2638c (diff) | |
download | volse-hubzilla-40bbdfdf6ac53b04d723881d91f8ea12999d97af.tar.gz volse-hubzilla-40bbdfdf6ac53b04d723881d91f8ea12999d97af.tar.bz2 volse-hubzilla-40bbdfdf6ac53b04d723881d91f8ea12999d97af.zip |
Merge branch 'dev' into 'dev'
provide auto redirect from zot6 /item permalinks
See merge request hubzilla/core!1684
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Item.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 901f54c72..3eac2b6a0 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -193,6 +193,25 @@ class Item extends Controller { 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'); + } + } |