summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2010-01-20 10:56:01 +0100
committerAdrian Lang <lang@cosmocode.de>2010-01-20 10:56:01 +0100
commit7d723f3d24511105ce37006f9439632c3d8f915e (patch)
tree605809aace3e368d953466f76425b41d56fa1b38 /inc/pageutils.php
parent1c64eaeaa3295062b0a4e9b20b772274cd86ca42 (diff)
parenteee44352b2c73d56818600770b87f891b88a545f (diff)
downloadrpg-7d723f3d24511105ce37006f9439632c3d8f915e.tar.gz
rpg-7d723f3d24511105ce37006f9439632c3d8f915e.tar.bz2
Merge branch 'subscription'
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);
+}