From d519720692b97f1c1705a3cce804749068fea697 Mon Sep 17 00:00:00 2001 From: chris <chris@jalakai.co.uk> Date: Mon, 3 Apr 2006 22:28:15 +0200 Subject: [PATCH] move hsc() & ptln() functions from template.php to common.php darcs-hash:20060403202815-9b6ab-1b499148333458ee8acb68b5e38ca72d3b1c9b3c.gz --- inc/common.php | 22 ++++++++++++++++++++++ inc/template.php | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) 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 <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. diff --git a/inc/template.php b/inc/template.php index 488ce211b..bda0a7e4b 100644 --- a/inc/template.php +++ b/inc/template.php @@ -9,28 +9,6 @@ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/'); require_once(DOKU_CONF.'dokuwiki.php'); -/** - * Wrapper around htmlspecialchars() - * - * @author Andreas Gohr <andi@splitbrain.org> - * @see htmlspecialchars() - */ -function hsc($string){ - return htmlspecialchars($string); -} - -/** - * 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"; -} - /** * Returns the path to the given template, uses * default one if the custom version doesn't exist -- GitLab