diff options
author | Hubzilla <hubzilla@hz.macgirvin.com> | 2017-01-19 15:37:30 -0800 |
---|---|---|
committer | Hubzilla <hubzilla@hz.macgirvin.com> | 2017-01-19 15:37:30 -0800 |
commit | 96f196febda488e1db2d9a677fd5eb736aa76ae6 (patch) | |
tree | 8e97ca43e8f963b46effe4baee587ebd76892d6d /Zotlabs/Module/Display.php | |
parent | 5ce96b9b95c6b3497bfb49fd086a23a2dedb4e2e (diff) | |
download | volse-hubzilla-96f196febda488e1db2d9a677fd5eb736aa76ae6.tar.gz volse-hubzilla-96f196febda488e1db2d9a677fd5eb736aa76ae6.tar.bz2 volse-hubzilla-96f196febda488e1db2d9a677fd5eb736aa76ae6.zip |
add gen_link_id() function to selectively encode/decode the message-id component of /display/ links for message-ids that contain troublesome characters
Diffstat (limited to 'Zotlabs/Module/Display.php')
-rw-r--r-- | Zotlabs/Module/Display.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 42f6dd4ac..638aa881a 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -30,12 +30,10 @@ class Display extends \Zotlabs\Web\Controller { if(argc() > 1 && argv(1) !== 'load') $item_hash = argv(1); - if($_REQUEST['mid']) $item_hash = $_REQUEST['mid']; - - - if(! $item_hash) { + + if(! $item_hash) { \App::$error = 404; notice( t('Item not found.') . EOL); return; @@ -93,9 +91,15 @@ class Display extends \Zotlabs\Web\Controller { // find a copy of the item somewhere $target_item = null; - + + if(strpos($item_hash,'b64.') === 0) + $decoded = @base64url_decode(substr($item_hash,4)); + if($decoded) + $item_hash = $decoded; + $r = q("select id, uid, mid, parent_mid, item_type, item_deleted from item where mid like '%s' limit 1", - dbesc($item_hash . '%') + dbesc($item_hash . '%'), + dbesc($decoded . '%') ); if($r) { |