aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-26 12:51:08 -0700
committerFriendika <info@friendika.com>2011-10-26 12:51:08 -0700
commit1aba538c96628468b84136386496ccc69050e810 (patch)
tree102830d438afcc8552db79a9284dc1555c8f9247 /include
parent9f5d7b254b4edef7e7d2ffa14eb7c3c03ea516fe (diff)
parent6a8b96709e13b04a0657c25b4538c160e2118131 (diff)
downloadvolse-hubzilla-1aba538c96628468b84136386496ccc69050e810.tar.gz
volse-hubzilla-1aba538c96628468b84136386496ccc69050e810.tar.bz2
volse-hubzilla-1aba538c96628468b84136386496ccc69050e810.zip
Merge branch 'pull'
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php2
-rw-r--r--include/oembed.php12
2 files changed, 7 insertions, 7 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index a60d09ce8..4d6eafafa 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -19,7 +19,7 @@ function tryoembed($match){
if ($o->type=="error") return $match[0];
$html = oembed_format_object($o);
- return oembed_iframe($html,$o->width,$o->height);
+ return $html; //oembed_iframe($html,$o->width,$o->height);
}
diff --git a/include/oembed.php b/include/oembed.php
index 71b62b839..3e86627e4 100644
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -4,7 +4,7 @@ function oembed_replacecb($matches){
$embedurl=$matches[1];
$j = oembed_fetch_url($embedurl);
$s = oembed_format_object($j);
- return oembed_iframe($s,$j->width,$j->height);
+ return $s;//oembed_iframe($s,$j->width,$j->height);
}
@@ -56,6 +56,7 @@ function oembed_fetch_url($embedurl){
function oembed_format_object($j){
$embedurl = $j->embedurl;
+ $jhtml = oembed_iframe($j->html,$j->width,$j->height );
$ret="<span class='oembed ".$j->type."'>";
switch ($j->type) {
case "video": {
@@ -68,14 +69,14 @@ function oembed_format_object($j){
$tpl=get_markup_template('oembed_video.tpl');
$ret.=replace_macros($tpl, array(
'$embedurl'=>$embedurl,
- '$escapedhtml'=>urlencode($j->html),
+ '$escapedhtml'=>base64_encode($jhtml),
'$tw'=>$tw,
'$th'=>$th,
'$turl'=>$j->thumbnail_url,
));
} else {
- $ret=$j->html;
+ $ret=$jhtml;
}
$ret.="<br>";
}; break;
@@ -88,12 +89,12 @@ function oembed_format_object($j){
}; break;
case "rich": {
// not so safe..
- $ret.= $j->html;
+ $ret.= $jhtml;
}; break;
}
// add link to source if not present in "rich" type
- if ( $j->type!='rich' || !strpos($ret,$embedurl) ){
+ if ( $j->type!='rich' || !strpos($j->html,$embedurl) ){
$embedlink = (isset($j->title))?$j->title:$embedurl;
$ret .= "<a href='$embedurl' rel='oembed'>$embedlink</a>";
if (isset($j->author_name)) $ret.=" by ".$j->author_name;
@@ -107,7 +108,6 @@ function oembed_format_object($j){
}
function oembed_iframe($src,$width,$height) {
-
if(! $width || strstr($width,'%'))
$width = '640';
if(! $height || strstr($height,'%'))