where possible strip zid parameter from links that get pasted into posts so that they will get a correct zid when rendered

This commit is contained in:
zotlabs
2018-04-26 20:27:14 -07:00
parent ce13fef6aa
commit 7b445a5b39
3 changed files with 11 additions and 5 deletions

View File

@@ -85,12 +85,14 @@ function tryoembed($match) {
function nakedoembed($match) {
$url = ((count($match) == 2) ? $match[1] : $match[2]);
$o = oembed_fetch_url($url);
$strip_url = strip_escaped_zids($url);
$o = oembed_fetch_url($strip_url);
if ($o['type'] == 'error')
return $match[0];
return str_replace($url,$strip_url,$match[0]);
return '[embed]' . $url . '[/embed]';
return '[embed]' . $strip_url . '[/embed]';
}
function tryzrlaudio($match) {