From 75b3410e836ec9ed525a8cc287b4d49ee7e33d14 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 14 Jun 2006 22:09:09 +0000 Subject: [PATCH] erm, ok, my fault. :/ git-svn-id: file:///svn/phpbb/trunk@6067 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/bbcode.php | 94 +++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index eb440cab24..f39c004747 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -459,55 +459,53 @@ class bbcode */ function bbcode_list($type) { - switch ($type) + if ($type == '') { - case '': - $tpl = 'ulist_open_default'; - $type = 'default'; - $start = 0; - break; - - case 'i': - $tpl = 'olist_open'; - $type = 'lower-roman'; - $start = 1; - break; - - case 'I': - $tpl = 'olist_open'; - $type = 'upper-roman'; - $start = 1; - break; - - case (preg_match('#^(disc|circle|square)$#i', $type)): - $tpl = 'ulist_open'; - $type = strtolower($type); - $start = 1; - break; - - case (preg_match('#^[a-z]$#', $type)): - $tpl = 'olist_open'; - $type = 'lower-alpha'; - $start = ord($type) - 96; - break; - - case (preg_match('#[A-Z]#', $type)): - $tpl = 'olist_open'; - $type = 'upper-alpha'; - $start = ord($type) - 64; - break; - - case (is_numeric($type)): - $tpl = 'olist_open'; - $type = 'arabic-numbers'; - $start = intval($type); - break; - - default: - $tpl = 'olist_open'; - $type = 'arabic-numbers'; - $start = 1; - break; + $tpl = 'ulist_open_default'; + $type = 'default'; + $start = 0; + } + else if ($type == 'i') + { + $tpl = 'olist_open'; + $type = 'lower-roman'; + $start = 1; + } + else if ($type == 'I') + { + $tpl = 'olist_open'; + $type = 'upper-roman'; + $start = 1; + } + else if (preg_match('#^(disc|circle|square)$#i', $type)) + { + $tpl = 'ulist_open'; + $type = strtolower($type); + $start = 1; + } + else if (preg_match('#^[a-z]$#', $type)) + { + $tpl = 'olist_open'; + $type = 'lower-alpha'; + $start = ord($type) - 96; + } + else if (preg_match('#[A-Z]#', $type)) + { + $tpl = 'olist_open'; + $type = 'upper-alpha'; + $start = ord($type) - 64; + } + else if (is_numeric($type)) + { + $tpl = 'olist_open'; + $type = 'arabic-numbers'; + $start = intval($type); + } + else + { + $tpl = 'olist_open'; + $type = 'arabic-numbers'; + $start = 1; } return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl));