From d519720692b97f1c1705a3cce804749068fea697 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Apr 2006 22:28:15 +0200 Subject: move hsc() & ptln() functions from template.php to common.php darcs-hash:20060403202815-9b6ab-1b499148333458ee8acb68b5e38ca72d3b1c9b3c.gz --- inc/common.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index 6f3cad2e4..8af63002c 100644 --- a/inc/common.php +++ b/inc/common.php @@ -20,6 +20,28 @@ define('RECENTS_SKIP_DELETED',2); define('RECENTS_SKIP_MINORS',4); define('RECENTS_SKIP_SUBSPACES',8); +/** + * Wrapper around htmlspecialchars() + * + * @author Andreas Gohr + * @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 + */ +function ptln($string,$intend=0){ + for($i=0; $i<$intend; $i++) print ' '; + print"$string\n"; +} + /** * Return info about the current document as associative * array. -- cgit v1.2.3