summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2010-01-05 14:14:00 +0100
committerAdrian Lang <lang@cosmocode.de>2010-01-20 10:53:18 +0100
commit5b75cd1f5c479ada468fbf62a733c54edad152f1 (patch)
tree7ca6012d892aaef60cee7bc86b2f62ade43e03ce /inc/pageutils.php
parentb5ee21aa65a2f380e3b99ff5ea6ced48c1cb720e (diff)
downloadrpg-5b75cd1f5c479ada468fbf62a733c54edad152f1.tar.gz
rpg-5b75cd1f5c479ada468fbf62a733c54edad152f1.tar.bz2
New mail subscription with digest
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php17
1 files changed, 17 insertions, 0 deletions
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 <lang@cosmocode.de>
+ */
+function prettyprint_id($id) {
+ if (!$id || $id === ':') {
+ return '*';
+ }
+ if ((substr($id, -1, 1) === ':')) {
+ $id .= '*';
+ }
+ return hsc($id);
+}