aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-07-14 01:38:16 -0700
committerfriendica <info@friendica.com>2014-07-14 01:38:16 -0700
commit233e4e13636edd857ded7393555feb4bf198eed3 (patch)
tree27c06018d534ff5e411a8aff4831a513d92801a5 /include/oembed.php
parent17bd39fcd4b28e6475a8a349f136c788202eaff4 (diff)
downloadvolse-hubzilla-233e4e13636edd857ded7393555feb4bf198eed3.tar.gz
volse-hubzilla-233e4e13636edd857ded7393555feb4bf198eed3.tar.bz2
volse-hubzilla-233e4e13636edd857ded7393555feb4bf198eed3.zip
remove some code duplication
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php16
1 files changed, 4 insertions, 12 deletions
diff --git a/include/oembed.php b/include/oembed.php
index 42a9881ed..de3a6edc8 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -29,18 +29,10 @@ function oembed_fetch_url($embedurl){
$txt = "";
if (in_array($ext, $noexts)) {
- $m = @parse_url($embedurl);
- $zrl = false;
- if($m['host']) {
- $r = q("select hubloc_url from hubloc where hubloc_host = '%s' limit 1",
- dbesc($m['host'])
- );
- if($r)
- $zrl = true;
- }
- if($zrl) {
- $embedurl = zid($embedurl);
- }
+ require_once('include/hubloc.php');
+ $zrl = is_matrix_url($embedurl);
+ if($zrl)
+ $embedurl = zid($embedurl);
}
else {
// try oembed autodiscovery