diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-06-25 13:58:24 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-06-25 13:58:24 +0200 |
commit | 2528d97f52da9c99c62aa6d41e7c442071747e5e (patch) | |
tree | 07f8a3b27609503bb7a7ab3335c6520b8a0ed63d /include | |
parent | c8ae04a96a38b7351c2ac506c836bb9b1734d58e (diff) | |
parent | ec3651d216a5eafcb8019825bc6751e6ffa8c198 (diff) | |
download | volse-hubzilla-2528d97f52da9c99c62aa6d41e7c442071747e5e.tar.gz volse-hubzilla-2528d97f52da9c99c62aa6d41e7c442071747e5e.tar.bz2 volse-hubzilla-2528d97f52da9c99c62aa6d41e7c442071747e5e.zip |
Merge branch 'dev' into sabre32
Diffstat (limited to 'include')
-rwxr-xr-x | include/oembed.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/oembed.php b/include/oembed.php index f1d9bd7d2..fe068278e 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -27,12 +27,6 @@ function oembed_action($embedurl) { logger('oembed_action: ' . $embedurl, LOGGER_DEBUG, LOG_INFO); - // These media files should now be caught in bbcode.php - // left here as a fallback in case this is called from another source - - $noexts = array("mp3","mp4","ogg","ogv","oga","ogm","webm","opus"); - $ext = pathinfo(strtolower($embedurl),PATHINFO_EXTENSION); - if(strpos($embedurl,'http://') === 0) { if(intval(get_config('system','embed_sslonly'))) { $action = 'block'; @@ -121,14 +115,19 @@ function oembed_fetch_url($embedurl){ // These media files should now be caught in bbcode.php // left here as a fallback in case this is called from another source - $noexts = array("mp3","mp4","ogg","ogv","oga","ogm","webm","opus"); - $ext = pathinfo(strtolower($embedurl),PATHINFO_EXTENSION); + $noexts = array(".mp3",".mp4",".ogg",".ogv",".oga",".ogm",".webm",".opus"); $result = oembed_action($embedurl); $embedurl = $result['url']; $action = $result['action']; + foreach($noexts as $ext) { + if(strpos(strtolower($embedurl),$ext) !== false) { + $action = 'block'; + } + } + $txt = null; if($action !== 'block') { @@ -153,7 +152,7 @@ function oembed_fetch_url($embedurl){ } - if (! in_array($ext, $noexts) && $action !== 'block') { + if ($action !== 'block') { // try oembed autodiscovery $redirects = 0; $result = z_fetch_url($furl, false, $redirects, array('timeout' => 15, 'accept_content' => "text/*", 'novalidate' => true )); |