]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'remotes/upstream/master'
authorSimon L'nu <simon.lnu@gmail.com>
Thu, 28 Jun 2012 16:12:43 +0000 (12:12 -0400)
committerSimon L'nu <simon.lnu@gmail.com>
Thu, 28 Jun 2012 16:12:43 +0000 (12:12 -0400)
* remotes/upstream/master:
  fix logic for nested lists--should be OR, not AND

include/bb2diaspora.php
include/bbcode.php

index 25edb28d7d8dd2eef87f9c4e7467f87e82b57f94..77a5f5c2a0b3cc6183c16feafb32d89819db3e23 100644 (file)
@@ -113,9 +113,9 @@ function bb2diaspora($Text,$preserve_nl = false) {
        // to define the closing tag for the list elements. So nested lists
        // are going to be flattened out in Diaspora for now
        $endlessloop = 0;
-       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)) {
+       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_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text);
                $Text = preg_replace_callback("/\[list=1\](.*?)\[\/list\]/is", 'diaspora_ol', $Text);
                $Text = preg_replace_callback("/\[list=i\](.*?)\[\/list\]/s",'diaspora_ol', $Text);
index ee31b4a1aa6b106e81f8ee9af7c3c95b494af934..9071c767b692e3e25bd84699a31c67b8bb04b220 100644 (file)
@@ -163,9 +163,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
        // handle nested lists
        $endlessloop = 0;
 
-       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)) {
+       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);