diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-09-08 09:22:36 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-09-08 09:22:36 +0200 |
commit | 108bb7649bb61bee65d9923c9080c3af8e715bc4 (patch) | |
tree | 4b96649d85d098de8e723df85b409cb0a43832d1 /include/oembed.php | |
parent | 7b3aa92b5ad09c0820db2b20bc462c975f0d3aba (diff) | |
parent | 1104e2652f15aaa405208b6dec9e439fb8c39537 (diff) | |
download | volse-hubzilla-108bb7649bb61bee65d9923c9080c3af8e715bc4.tar.gz volse-hubzilla-108bb7649bb61bee65d9923c9080c3af8e715bc4.tar.bz2 volse-hubzilla-108bb7649bb61bee65d9923c9080c3af8e715bc4.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-x | include/oembed.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/oembed.php b/include/oembed.php index 460e0244e..f662d84c7 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -225,6 +225,17 @@ function oembed_fetch_url($embedurl){ if($j['html']) { $orig = $j['html']; $allow_position = (($is_matrix) ? true : false); + + // some sites wrap their entire embed in an iframe + // which we will purify away and which we provide anyway. + // So if we see this, grab the frame src url and use that + // as the embed content - which will still need to be purified. + + if(preg_match('#<iframe(.*?)src=[\'\"](.?*)[\'\"]#',$matches,$j['html'])) { + $x = z_fetch_url($matches[2]); + $j['html'] = $x['body']; + } + $j['html'] = purify_html($j['html'],$allow_position); if($j['html'] != $orig) { logger('oembed html was purified. original: ' . $orig . ' purified: ' . $j['html'], LOGGER_DEBUG, LOG_INFO); |