X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=d1cb1a9110d3484a48f75e4dc66dd9e5ff379d89;hb=30efb0c1e641b0b9d3aa40a5a79897c6d06ac3ef;hp=a536b53649523fbfd37efdc9962f4a8f0ddd760d;hpb=209343d883d59dd7dd4c97056e32d6fdeae7ccec;p=friendica.git
diff --git a/include/bbcode.php b/include/bbcode.php
index a536b53649..d1cb1a9110 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1,8 +1,77 @@
".$st[2]."";
}
@@ -23,7 +92,7 @@ function cleancss($input) {
if (($char >= "a") and ($char <= "z"))
$cleaned .= $char;
- if (!(strpos(" #;:0123456789", $char) === false))
+ if (!(strpos(" #;:0123456789-_", $char) === false))
$cleaned .= $char;
}
@@ -36,7 +105,12 @@ function stripcode_br_cb($s) {
function tryoembed($match){
$url = ((count($match)==2)?$match[1]:$match[2]);
-// logger("tryoembed: $url");
+
+ // 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);
@@ -254,22 +328,30 @@ function bb_ShareAttributes($match) {
if ($matches[1] != "")
$profile = $matches[1];
- $posted = "";
- preg_match("/posted='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
- $posted = $matches[1];
+ $posted = "";
+
+ $itemcache = get_config("system","itemcache");
+
+ // relative dates only make sense when they aren't cached
+ if ($itemcache == "") {
+ preg_match("/posted='(.*?)'/ism", $attributes, $matches);
+ if ($matches[1] != "")
+ $posted = $matches[1];
+
+ preg_match('/posted="(.*?)"/ism', $attributes, $matches);
+ if ($matches[1] != "")
+ $posted = $matches[1];
- preg_match('/posted="(.*?)"/ism', $attributes, $matches);
- if ($matches[1] != "")
- $posted = $matches[1];
$reldate = (($posted) ? " " . relative_date($posted) : '');
+ }
- $headline = '
'.trim($match[3])."
'.trim($match[3])."