diff options
author | Zach Prezkuta <fermion@gmx.com> | 2012-06-23 20:01:29 -0600 |
---|---|---|
committer | Zach Prezkuta <fermion@gmx.com> | 2012-06-23 20:01:29 -0600 |
commit | 1f968396749f8cac31aaeee770ae7fc5aff48f38 (patch) | |
tree | 01cd1478ac4e00f08e76b154d849a708fb914550 /include | |
parent | 4ef33ac6ebbf7418742a9ee7a4a549808754eb1f (diff) | |
download | volse-hubzilla-1f968396749f8cac31aaeee770ae7fc5aff48f38.tar.gz volse-hubzilla-1f968396749f8cac31aaeee770ae7fc5aff48f38.tar.bz2 volse-hubzilla-1f968396749f8cac31aaeee770ae7fc5aff48f38.zip |
small optimization
Diffstat (limited to 'include')
-rw-r--r-- | include/bb2diaspora.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index d509a2e31..75ba57dff 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -113,18 +113,16 @@ function bb2diaspora($Text,$preserve_nl = false) { // text with opening and closing tags, so nested lists may make things // wonky $endlessloop = 0; - while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && - (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && - (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && (++$endlessloop < 20)) { + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && (++$endlessloop < 20)) { $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text); - $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/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); $Text = preg_replace_callback("/\[list=I\](.*?)\[\/list\]/s", 'diaspora_ol', $Text); $Text = preg_replace_callback("/\[list=a\](.*?)\[\/list\]/s", 'diaspora_ol', $Text); $Text = preg_replace_callback("/\[list=A\](.*?)\[\/list\]/s", 'diaspora_ol', $Text); - $Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text); } + $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text); + $Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text); // Convert it to HTML - don't try oembed $Text = bbcode($Text, $preserve_nl, false); |