summaryrefslogtreecommitdiff
path: root/inc/parserutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2007-01-28 12:39:52 +0100
committerAndreas Gohr <andi@splitbrain.org>2007-01-28 12:39:52 +0100
commit3b3f8916a9e666028ebc10723d6bea99de1342cc (patch)
treef7506c873d77e6e9ff527b1d329deb09aca4a042 /inc/parserutils.php
parentfc18c0fbae82b1bd3d6b74b486798753afea2c73 (diff)
downloadrpg-3b3f8916a9e666028ebc10723d6bea99de1342cc.tar.gz
rpg-3b3f8916a9e666028ebc10723d6bea99de1342cc.tar.bz2
small fix for metadata rendering if instructions aren't available
darcs-hash:20070128113952-7ad00-e7293a11680aed2cd88aac49d2a8b612bd0e61ee.gz
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r--inc/parserutils.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/inc/parserutils.php b/inc/parserutils.php
index 68ccd3231..57a0c68ca 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -185,7 +185,7 @@ function p_cached_instructions($file,$cacheonly=false,$id='') {
return $ins;
}
- return NULL;
+ return null;
}
/**
@@ -277,7 +277,7 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){
foreach ($value as $subkey => $subvalue){
$meta['current'][$key][$subkey] = array_merge($meta['current'][$key][$subkey], $subvalue);
- if ($persistent)
+ if ($persistent)
$meta['persistent'][$key][$subkey] = array_merge($meta['persistent'][$key][$subkey], $subvalue);
}
@@ -307,7 +307,7 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){
// sync cached copies, including $INFO metadata
global $cache_metadata, $INFO;
-
+
if (!empty($cache_metadata[$id])) $cache_metadata[$id] = $meta;
if (!empty($INFO) && ($id == $INFO['id'])) { $INFO['meta'] = $meta['current']; }
@@ -372,7 +372,7 @@ function p_read_metadata($id,$cache=false) {
function p_render_metadata($id, $orig){
// add an extra key for the event - to tell event handlers the page whose metadata this is
- $orig['page'] = $id;
+ $orig['page'] = $id;
$evt = new Doku_Event('PARSER_METADATA_RENDER', $orig);
if ($evt->advise_before()) {
@@ -380,6 +380,7 @@ function p_render_metadata($id, $orig){
// get instructions
$instructions = p_cached_instructions(wikiFN($id),false,$id);
+ if(is_null($instructions)) return null; // something went wrong with the instructions
// set up the renderer
$renderer = & new Doku_Renderer_metadata();
@@ -560,7 +561,7 @@ function p_render($mode,$instructions,& $info){
*
* @param string $id dokuwiki page id
* @param bool $render rerender if first heading not known
- * default: false -- this protects against loops where $id requires a
+ * default: false -- this protects against loops where $id requires a
* first heading further pages which eventually result
* in a request for a first heading from a page already
* in the chain (FS#1010)