summaryrefslogtreecommitdiff
path: root/inc/parserutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-11-08 23:15:08 +0100
committerAndreas Gohr <andi@splitbrain.org>2012-11-08 23:15:08 +0100
commit04924b7a9d090c0814cfff3e6706263e4d5a46e8 (patch)
treed83fc6b5683fbc9c639bfd1832f96dca2f3c8646 /inc/parserutils.php
parent1ea7a6bada66fc9b7a45f61b4892e4ea23196d89 (diff)
parenta731ed1d6736ca405b3559adfd9500affcc59412 (diff)
downloadrpg-04924b7a9d090c0814cfff3e6706263e4d5a46e8.tar.gz
rpg-04924b7a9d090c0814cfff3e6706263e4d5a46e8.tar.bz2
Merge branch 'master' into proxyconnect
* master: (169 commits) added PCRE UTF-8 checks to do=check FS#2636 avoid multiple paralell update checks fix regression bug in HTTPClient FS#2621 changed PAGEUTILS_ID_HIDEPAGE to has BEFORE/AFTER TarLib code cleanup TarLib: fixed appending in non-dynamic mode fixed third method of adding files in TarLib fix lone zero block in TarLib created archives fix use of constructor in TarLib Slovak language update Korean language update Latvian language update added event PAGEUTILS_ID_HIDEPAGE added test for isHiddenPage() removed redundant variables in tpl_include_page() (because of 3ff8773b) added cut off points for mobile devices as parameters to style.ini Corrected typo: ruke -> rule Persian language update Spanish language update russian language update ...
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r--inc/parserutils.php25
1 files changed, 18 insertions, 7 deletions
diff --git a/inc/parserutils.php b/inc/parserutils.php
index 20f992ba2..1733fcf09 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -386,9 +386,18 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){
if ($key == 'relation'){
foreach ($value as $subkey => $subvalue){
- $meta['current'][$key][$subkey] = !empty($meta['current'][$key][$subkey]) ? array_merge($meta['current'][$key][$subkey], $subvalue) : $subvalue;
- if ($persistent)
- $meta['persistent'][$key][$subkey] = !empty($meta['persistent'][$key][$subkey]) ? array_merge($meta['persistent'][$key][$subkey], $subvalue) : $subvalue;
+ if(isset($meta['current'][$key][$subkey]) && is_array($meta['current'][$key][$subkey])) {
+ $meta['current'][$key][$subkey] = array_merge($meta['current'][$key][$subkey], (array)$subvalue);
+ } else {
+ $meta['current'][$key][$subkey] = $subvalue;
+ }
+ if($persistent) {
+ if(isset($meta['persistent'][$key][$subkey]) && is_array($meta['persistent'][$key][$subkey])) {
+ $meta['persistent'][$key][$subkey] = array_merge($meta['persistent'][$key][$subkey], (array)$subvalue);
+ } else {
+ $meta['persistent'][$key][$subkey] = $subvalue;
+ }
+ }
}
// be careful with some senisitive arrays of $meta
@@ -396,10 +405,10 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){
// these keys, must have subkeys - a legitimate value must be an array
if (is_array($value)) {
- $meta['current'][$key] = !empty($meta['current'][$key]) ? array_merge($meta['current'][$key],$value) : $value;
+ $meta['current'][$key] = !empty($meta['current'][$key]) ? array_merge((array)$meta['current'][$key],$value) : $value;
if ($persistent) {
- $meta['persistent'][$key] = !empty($meta['persistent'][$key]) ? array_merge($meta['persistent'][$key],$value) : $value;
+ $meta['persistent'][$key] = !empty($meta['persistent'][$key]) ? array_merge((array)$meta['persistent'][$key],$value) : $value;
}
}
@@ -570,7 +579,7 @@ function p_get_parsermodes(){
$obj = null;
foreach($pluginlist as $p){
/** @var DokuWiki_Syntax_Plugin $obj */
- if(!$obj =& plugin_load('syntax',$p)) continue; //attempt to load plugin into $obj
+ if(!$obj = plugin_load('syntax',$p)) continue; //attempt to load plugin into $obj
$PARSER_MODES[$obj->getType()][] = "plugin_$p"; //register mode type
//add to modes
$modes[] = array(
@@ -668,7 +677,9 @@ function p_render($mode,$instructions,&$info){
// Loop through the instructions
foreach ( $instructions as $instruction ) {
// Execute the callback against the Renderer
- call_user_func_array(array(&$Renderer, $instruction[0]), $instruction[1] ? $instruction[1] : array());
+ if(method_exists($Renderer, $instruction[0])){
+ call_user_func_array(array(&$Renderer, $instruction[0]), $instruction[1] ? $instruction[1] : array());
+ }
}
//set info array