summaryrefslogtreecommitdiffstats
path: root/system/helpers/typography_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/typography_helper.php')
-rw-r--r--system/helpers/typography_helper.php46
1 files changed, 26 insertions, 20 deletions
diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php
index 4a746c6e4..4d9a1bb6b 100644
--- a/system/helpers/typography_helper.php
+++ b/system/helpers/typography_helper.php
@@ -34,28 +34,31 @@
* @param string
* @return string
*/
-function nl2br_except_pre($str)
+if (! function_exists('nl2br_except_pre'))
{
- $ex = explode("pre>",$str);
- $ct = count($ex);
-
- $newstr = "";
- for ($i = 0; $i < $ct; $i++)
+ function nl2br_except_pre($str)
{
- if (($i % 2) == 0)
- {
- $newstr .= nl2br($ex[$i]);
- }
- else
+ $ex = explode("pre>",$str);
+ $ct = count($ex);
+
+ $newstr = "";
+ for ($i = 0; $i < $ct; $i++)
{
- $newstr .= $ex[$i];
- }
+ if (($i % 2) == 0)
+ {
+ $newstr .= nl2br($ex[$i]);
+ }
+ else
+ {
+ $newstr .= $ex[$i];
+ }
- if ($ct - 1 != $i)
- $newstr .= "pre>";
- }
+ if ($ct - 1 != $i)
+ $newstr .= "pre>";
+ }
- return $newstr;
+ return $newstr;
+ }
}
// ------------------------------------------------------------------------
@@ -68,10 +71,13 @@ function nl2br_except_pre($str)
* @param string
* @return string
*/
-function auto_typography($str)
+if (! function_exists('auto_typography'))
{
- $TYPE = new Auto_typography();
- return $TYPE->convert($str);
+ function auto_typography($str)
+ {
+ $TYPE = new Auto_typography();
+ return $TYPE->convert($str);
+ }
}
// ------------------------------------------------------------------------