summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-04-03 22:28:15 +0200
committerchris <chris@jalakai.co.uk>2006-04-03 22:28:15 +0200
commitd519720692b97f1c1705a3cce804749068fea697 (patch)
treeddaa7fb914ff22c582659055d5f4e0f3f8a58e7b /inc/common.php
parentab77016bb3d1f490604f27ebc2f23c4372ca859d (diff)
downloadrpg-d519720692b97f1c1705a3cce804749068fea697.tar.gz
rpg-d519720692b97f1c1705a3cce804749068fea697.tar.bz2
move hsc() & ptln() functions from template.php to common.php
darcs-hash:20060403202815-9b6ab-1b499148333458ee8acb68b5e38ca72d3b1c9b3c.gz
Diffstat (limited to 'inc/common.php')
-rw-r--r--inc/common.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/inc/common.php b/inc/common.php
index 6f3cad2e4..8af63002c 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -21,6 +21,28 @@ define('RECENTS_SKIP_MINORS',4);
define('RECENTS_SKIP_SUBSPACES',8);
/**
+ * Wrapper around htmlspecialchars()
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see htmlspecialchars()
+ */
+function hsc($string){
+ return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
+}
+
+/**
+ * print a newline terminated string
+ *
+ * You can give an indention as optional parameter
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function ptln($string,$intend=0){
+ for($i=0; $i<$intend; $i++) print ' ';
+ print"$string\n";
+}
+
+/**
* Return info about the current document as associative
* array.
*