summaryrefslogtreecommitdiffstats
path: root/inc/util.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2013-10-29 20:02:30 +0100
committerSimon Rettberg2013-10-29 20:02:30 +0100
commit010656745dd6f7db6b09ec501ad3bb1e202b9a96 (patch)
tree2900c8daafe4b0b79cd6766348eb6db0b763bc54 /inc/util.inc.php
parentDB-Support, add user functionality (diff)
downloadslx-admin-010656745dd6f7db6b09ec501ad3bb1e202b9a96.tar.gz
slx-admin-010656745dd6f7db6b09ec501ad3bb1e202b9a96.tar.xz
slx-admin-010656745dd6f7db6b09ec501ad3bb1e202b9a96.zip
First version of basic minilinux configuration
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r--inc/util.inc.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/inc/util.inc.php b/inc/util.inc.php
index b4a0036e..0d85b989 100644
--- a/inc/util.inc.php
+++ b/inc/util.inc.php
@@ -32,5 +32,15 @@ class Util
Message::addError('token');
return false;
}
+
+ function markup($string)
+ {
+ $string = htmlspecialchars($string);
+ $string = preg_replace('#(^|[\n \-_/\.])\*(.+?)\*($|[ \-_/\.\!\?,])#is', '$1<b>$2</b>$3', $string);
+ $string = preg_replace('#(^|[\n \-\*/\.])_(.+?)_($|[ \-\*/\.\!\?,])#is', '$1<u>$2</u>$3', $string);
+ $string = preg_replace('#(^|[\n \-_\*\.])/(.+?)/($|[ \-_\*\.\!\?,])#is', '$1<i>$2</i>$3', $string);
+ return nl2br($string);
+ }
+
}