X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Futil.php;h=56753debe0ac5e1bfdc1d4031eeb0a09aeab70fd;hb=8284b3cb82f4dec6e0f2bf74dea6e1a3bc7f4eac;hp=441dcf68e3a7bc4b89a5c7f4bad62f402bca9191;hpb=2cabfba767ba0d92d34a6ea4e4cf91c7325f3e95;p=quix0rs-gnu-social.git diff --git a/lib/util.php b/lib/util.php index 441dcf68e3..56753debe0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -442,9 +442,9 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) { ')'. '(?:'. '(?:\:\d+)?'. //:port - '(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"]*)?'. // /path - '(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/]*)?'. // ?query string - '(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/\?\#]*)?'. // #fragment + '(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"@]*)?'. // /path + '(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"@\/]*)?'. // ?query string + '(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\@/\?\#]*)?'. // #fragment ')(?filename)) { + if ($f->isEnclosure()) { $is_attachment = true; $attachment_id = $f->id; - } else { // if it has OEmbed info, it's an attachment, too + } else { $foe = File_oembed::staticGet('file_id', $f->id); if (!empty($foe)) { + // if it has OEmbed info, it's an attachment, too $is_attachment = true; $attachment_id = $f->id; @@ -1393,9 +1394,6 @@ function common_shorten_url($long_url) $short_url_service = $reflectionObj->newInstanceArgs($_shorteners[$svc]['callInfo'][1]); $short_url = $short_url_service->shorten($long_url); - if(substr($short_url,0,7)=='http://'){ - $short_url = substr($short_url,7); - } return $short_url; }