aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-25 15:34:57 -0700
committerfriendica <info@friendica.com>2012-06-25 15:34:57 -0700
commit89ad19ce01f396ca71f4a991699871b26cf90b29 (patch)
tree7640598f99b1dfddc8a8a77f9ae13f5e438979c2 /include/bbcode.php
parenteebb2d2120b91c09238e970b2292059a04960aa7 (diff)
parentd944ff7833355f3bae7befd9c97becf01c4083b1 (diff)
downloadvolse-hubzilla-89ad19ce01f396ca71f4a991699871b26cf90b29.tar.gz
volse-hubzilla-89ad19ce01f396ca71f4a991699871b26cf90b29.tar.bz2
volse-hubzilla-89ad19ce01f396ca71f4a991699871b26cf90b29.zip
Merge https://github.com/friendica/friendica into pull
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index f542ad263..38d1e658f 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -162,7 +162,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// handle nested lists
$endlessloop = 0;
- while ((strpos($Text, "[/list]") !== false) and (strpos($Text, "[list") !== false) and (++$endlessloop < 20)) {
+ while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)
+ (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) &&
+ (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) {
$Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '<ul class="listnone" style="list-style-type: none;">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);
@@ -170,11 +172,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = preg_replace("/\[list=((?-i)I)\](.*?)\[\/list\]/ism", '<ul class="listupperroman" style="list-style-type: upper-roman;">$2</ul>' ,$Text);
$Text = preg_replace("/\[list=((?-i)a)\](.*?)\[\/list\]/ism", '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$2</ul>' ,$Text);
$Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$2</ul>' ,$Text);
+ $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);
}
- $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
- $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);
-
$Text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '<th>$1</th>' ,$Text);
$Text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '<td>$1</td>' ,$Text);
$Text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '<tr>$1</tr>' ,$Text);