X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=a14e3ee8e9b88f9377b6d9ed02adb73b1e18e59e;hb=dbb5df7f7d65e4f94add3f0684d9bff40e5f8167;hp=9a43cdb305e140222650bcfdd9dd97f307da934b;hpb=4a473611163a12b48d3bbad71dc54765be8789f9;p=friendica.git
diff --git a/include/bbcode.php b/include/bbcode.php
index 9a43cdb305..a14e3ee8e9 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1,6 +1,7 @@
%s
', $data["url"], $data["title"]);
} else {
- $text = sprintf('', $data["type"]);
+ if ($simplehtml != 4) {
+ $text = sprintf('', $data["type"]);
+ } else {
+ $span_end = '';
+ }
$bookmark = array(sprintf('[bookmark=%s]%s[/bookmark]', $data["url"], $data["title"]), $data["url"], $data["title"]);
if ($tryoembed) {
@@ -71,22 +77,26 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {
if (strstr(strtolower($oembed), "', trim(bbcode($data["description"])));
+ $text .= sprintf('%s
', trim(bbcode($data["description"])));
}
}
+
+ if ($simplehtml != 4) {
+ $text .= '';
+ }
}
return trim($data["text"].' '.$text.' '.$data["after"]);
}
@@ -103,25 +113,25 @@ function bb_remove_share_information($Text, $plaintext = false, $nolink = false)
$title = htmlentities($data["title"], ENT_QUOTES, 'UTF-8', false);
$text = htmlentities($data["text"], ENT_QUOTES, 'UTF-8', false);
- if ($plaintext OR (($title != "") AND strstr($text, $title))) {
+ if ($plaintext || (($title != "") && strstr($text, $title))) {
$data["title"] = $data["url"];
- } elseif (($text != "") AND strstr($title, $text)) {
+ } elseif (($text != "") && strstr($title, $text)) {
$data["text"] = $data["title"];
$data["title"] = $data["url"];
}
- if (($data["text"] == "") AND ($data["title"] != "") AND ($data["url"] == "")) {
+ if (($data["text"] == "") && ($data["title"] != "") && ($data["url"] == "")) {
return $data["title"] . $data["after"];
}
// If the link already is included in the post, don't add it again
- if (($data["url"] != "") AND strpos($data["text"], $data["url"])) {
+ if (($data["url"] != "") && strpos($data["text"], $data["url"])) {
return $data["text"] . $data["after"];
}
$text = $data["text"];
- if (($data["url"] != "") AND ($data["title"] != "")) {
+ if (($data["url"] != "") && ($data["title"] != "")) {
$text .= "\n[url=" . $data["url"] . "]" . $data["title"] . "[/url]";
} elseif (($data["url"] != "")) {
$text .= "\n" . $data["url"];
@@ -147,7 +157,7 @@ function cleancss($input) {
for ($i = 0; $i < strlen($input); $i++) {
$char = substr($input, $i, 1);
- if (($char >= "a") and ($char <= "z")) {
+ if (($char >= "a") && ($char <= "z")) {
$cleaned .= $char;
}
@@ -167,7 +177,7 @@ function cleancss($input) {
function bb_style_url($match) {
$url = $match[1];
- if (isset($match[2]) AND ($match[1] != $match[2])) {
+ if (isset($match[2]) && ($match[1] != $match[2])) {
return $match[0];
}
@@ -485,20 +495,20 @@ function bb_ShareAttributes($share, $simplehtml) {
$data = get_contact_details_by_url($profile);
- if (isset($data["name"]) AND ($data["name"] != "") AND isset($data["addr"]) AND ($data["addr"] != ""))
+ if (isset($data["name"]) && ($data["name"] != "") && isset($data["addr"]) && ($data["addr"] != ""))
$userid_compact = $data["name"]." (".$data["addr"].")";
else
$userid_compact = GetProfileUsername($profile,$author, true);
- if (isset($data["addr"]) AND ($data["addr"] != ""))
+ if (isset($data["addr"]) && ($data["addr"] != ""))
$userid = $data["addr"];
else
$userid = GetProfileUsername($profile,$author, false);
- if (isset($data["name"]) AND ($data["name"] != ""))
+ if (isset($data["name"]) && ($data["name"] != ""))
$author = $data["name"];
- if (isset($data["micro"]) AND ($data["micro"] != ""))
+ if (isset($data["micro"]) && ($data["micro"] != ""))
$avatar = $data["micro"];
$preshare = trim($share[1]);
@@ -531,10 +541,9 @@ function bb_ShareAttributes($share, $simplehtml) {
break;
case 4:
- $headline = '
$2", $Text); @@ -1148,7 +1162,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa // Check for [quote] text // handle nested quotes $endlessloop = 0; - while ((strpos($Text, "[/quote]") !== false) and (strpos($Text, "[quote]") !== false) and (++$endlessloop < 20)) { + while ((strpos($Text, "[/quote]") !== false) && (strpos($Text, "[quote]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism", "$QuoteLayout", $Text); } @@ -1158,7 +1172,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa // handle nested quotes $endlessloop = 0; - while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20)) { + while ((strpos($Text, "[/quote]")!== false) && (strpos($Text, "[quote=") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", "
$2", $Text); @@ -1184,9 +1198,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa return bb_ShareAttributes($match, $simplehtml); }, $Text); - $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '
([^<]*)
(?!