aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-06-25 18:37:27 -0700
committerzotlabs <mike@macgirvin.com>2019-06-25 18:37:27 -0700
commit5ee70092712be1604ce1450a8735154fdb7c9485 (patch)
treeef6ae6b36e23950a4701bf09dd9db83b2dcaf63a /Zotlabs
parent952e466d9121726f00c94b6527ff01255529b82c (diff)
downloadvolse-hubzilla-5ee70092712be1604ce1450a8735154fdb7c9485.tar.gz
volse-hubzilla-5ee70092712be1604ce1450a8735154fdb7c9485.tar.bz2
volse-hubzilla-5ee70092712be1604ce1450a8735154fdb7c9485.zip
provide auto redirect from zot6 /item permalinks
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Item.php19
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');
+ }
+
}