Merge branch 'dev' into 'dev'

Replace plink URL with 'share' tag if possible

See merge request hubzilla/core!1703
This commit is contained in:
Mario 2019-08-09 20:26:54 +02:00
commit 940e4a6152

View File

@ -2,9 +2,6 @@
namespace Zotlabs\Module;
class Linkinfo extends \Zotlabs\Web\Controller {
function get() {
@ -49,6 +46,19 @@ class Linkinfo extends \Zotlabs\Web\Controller {
logger('linkinfo: ' . $url);
// Replace plink URL with 'share' tag if possible
if (preg_match("/mid=b64\.(\w+)(&.+)?$/", $url, $mid)) {
$r = q("SELECT id FROM item WHERE mid = '%s' AND uid = %d LIMIT 1",
dbesc(base64url_decode($mid[1])),
intval(local_channel())
);
if ($r) {
echo "[share=" . $r[0]['id'] . "][/share]";
killme();
}
}
$result = z_fetch_url($url,false,0,array('novalidate' => true, 'nobody' => true));
if($result['success']) {
$hdrs=array();