From 5b75cd1f5c479ada468fbf62a733c54edad152f1 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Tue, 5 Jan 2010 14:14:00 +0100 Subject: New mail subscription with digest --- inc/pageutils.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 9c192e5e6..239ff41c5 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -534,4 +534,21 @@ function isVisiblePage($id){ return !isHiddenPage($id); } +/** + * Format an id for output to a user + * + * Namespaces are denoted by a trailing “:*”. The root namespace is + * “*”. Output is escaped. + * + * @author Adrian Lang + */ +function prettyprint_id($id) { + if (!$id || $id === ':') { + return '*'; + } + if ((substr($id, -1, 1) === ':')) { + $id .= '*'; + } + return hsc($id); +} -- cgit v1.2.3