diff --git a/include/bbcode.php b/include/bbcode.php
index 100c3b930..b68a7c5b1 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -301,14 +301,12 @@ function bb_onelinecode_cb($match) {
}
function tryoembed($match){
- //$url = ((count($match)==2)?$match[1]:$match[2]);
$url = $match[1];
// Always embed the SSL version
$url = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"),
array("https://www.youtube.com/", "https://player.vimeo.com/"), $url);
- //logger("tryoembed: $url");
$o = oembed_fetch_url($url);
@@ -318,7 +316,7 @@ function tryoembed($match){
if ($o->type=="error") return $match[0];
$html = oembed_format_object($o);
- return $html; //oembed_iframe($html,$o->width,$o->height);
+ return $html;
}
diff --git a/include/oembed.php b/include/oembed.php
index 0e1238360..c848a4580 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -1,12 +1,9 @@
width,$j->height);
-
-
+ return $s;
}
@@ -144,15 +141,12 @@ function oembed_format_object($j){
} else {
$ret=$jhtml;
}
- $ret.="
";
+ //$ret.="
";
}; break;
case "photo": {
$ret.= "
";
- //$ret.= "
";
- $ret.="
";
}; break;
case "link": {
- //$ret = "".$j->title."";
}; break;
case "rich": {
// not so safe..
@@ -194,10 +188,10 @@ function oembed_format_object($j){
} else {
// add for html2bbcode conversion
$ret .= "$embedurl";
- $ret .= "
";
}
$ret.="";
- return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));
+ $ret = str_replace("\n","",$ret);
+ return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));
}
function oembed_iframe($src,$width,$height) {
diff --git a/js/main.js b/js/main.js
index f106b3daf..ca4cc770c 100644
--- a/js/main.js
+++ b/js/main.js
@@ -1,22 +1,22 @@
- function resizeIframe(obj) {
- obj.style.height = 0;
- _resizeIframe(obj, 0);
- }
-
- function _resizeIframe(obj, desth) {
- var h = obj.style.height;
- var ch = obj.contentWindow.document.body.scrollHeight + 'px';
- if (h==ch) {
- return;
+ function resizeIframe(obj) {
+ //obj.style.height = 0;
+ _resizeIframe(obj, 0);
}
- console.log("_resizeIframe", obj, desth, ch);
- if (desth!=ch) {
- setTimeout(_resizeIframe, 500, obj, ch);
- } else {
- obj.style.height = ch;
- setTimeout(_resizeIframe, 1000, obj, ch);
+
+ function _resizeIframe(obj, desth) {
+ var h = obj.style.height;
+ var ch = obj.contentWindow.document.body.scrollHeight + 'px';
+ if (h==ch) {
+ return;
+ }
+ console.log("_resizeIframe", obj, desth, ch);
+ if (desth!=ch) {
+ setTimeout(_resizeIframe, 500, obj, ch);
+ } else {
+ if (ch>0) obj.style.height = ch;
+ setTimeout(_resizeIframe, 1000, obj, ch);
+ }
}
- }
function openClose(theID) {
if(document.getElementById(theID).style.display == "block") {
diff --git a/mod/oembed.php b/mod/oembed.php
index f79f66a48..cb478cb86 100644
--- a/mod/oembed.php
+++ b/mod/oembed.php
@@ -21,6 +21,12 @@ function oembed_content(&$a){
$url = base64url_decode($a->argv[1]);
$j = oembed_fetch_url($url);
+ // workaround for media.ccc.de (and any other endpoint that return size 0)
+ if (substr($j->html, 0, 7) == "