summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/common.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/inc/common.php b/inc/common.php
index 9cadb56fd..a8ac6f7de 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -808,7 +808,6 @@ function rawWiki($id,$rev=''){
function pageTemplate($data){
$id = $data[0];
global $conf;
- global $INFO;
$path = dirname(wikiFN($id));
@@ -825,7 +824,16 @@ function pageTemplate($data){
$path = substr($path, 0, strrpos($path, '/'));
}
}
- if(!$tpl) return '';
+ return isset($tpl) ? parsePageTemplate($tpl, $id) : '';
+}
+
+/**
+ * Performs common page template replacements
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function parsePageTemplate($tpl, $id) {
+ global $INFO;
// replace placeholders
$file = noNS($id);
@@ -868,7 +876,6 @@ function pageTemplate($data){
return $tpl;
}
-
/**
* Returns the raw Wiki Text in three slices.
*