aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
committerPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
commit56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41 (patch)
treec1376be525c85ab799f213ed79648d8c478da3d0 /include/oembed.php
parent9edaa2843b9982f52fb1ed93b1c6e3d9e53921d7 (diff)
parent44c4c9c5c271a5ad163a089b1dc271d108a59700 (diff)
downloadvolse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.gz
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.bz2
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.zip
Merge pull request #6 from tuscanhobbit/master
Fast forward local hub
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/oembed.php b/include/oembed.php
index 8ce0fee96..e08b287d1 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -92,7 +92,8 @@ function oembed_fetch_url($embedurl){
function oembed_format_object($j){
$a = get_app();
$embedurl = $j->embedurl;
- $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) );
+
+ $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null));
$ret="<span class='oembed ".$j->type."'>";
switch ($j->type) {
@@ -127,7 +128,6 @@ function oembed_format_object($j){
}; break;
case "photo": {
$ret.= "<img width='".$j->width."' src='".$j->url."'>";
- //$ret.= "<img width='".$j->width."' height='".$j->height."' src='".$j->url."'>";
$ret.="<br>";
}; break;
case "link": {
@@ -163,13 +163,12 @@ function oembed_iframe($src,$width,$height) {
$height = intval($height) + 80;
$width = intval($width) + 40;
- $a = get_app();
-
- $sandbox = ((strpos($src,get_app()->get_hostname())) ? ' sandbox="allow-scripts" ' : '');
+ $s = z_root() . '/oembed/' . base64url_encode($src);
- $s = $a->get_baseurl()."/oembed/".base64url_encode($src);
+ // Make sure any children are sandboxed within their own iframe.
- return '<iframe ' . $sandbox . ' height="' . $height . '" width="' . $width . '" src="' . $s . '" frameborder="no" >' . t('Embedded content') . '</iframe>';
+ return '<iframe height="' . $height . '" width="' . $width . '" src="' . $s . '" frameborder="no" >'
+ . t('Embedded content') . '</iframe>';
}