summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMatthias Schulte <post@lupo49.de>2011-04-27 11:21:29 +0200
committerMatthias Schulte <post@lupo49.de>2011-04-27 11:21:29 +0200
commitfe537d1f0b6774de31df6c59911388d485ddc752 (patch)
tree2118b1bdf4e10289f06b69cc38c4c7fad8331101 /inc
parent02901e5af5803ff428586d8b287064a2cf7c5231 (diff)
parent65f40513c558b4d57493485465b12d493911f2a5 (diff)
downloadrpg-fe537d1f0b6774de31df6c59911388d485ddc752.tar.gz
rpg-fe537d1f0b6774de31df6c59911388d485ddc752.tar.bz2
Merge remote branch 'upstream/master'
Diffstat (limited to 'inc')
-rw-r--r--inc/parserutils.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/inc/parserutils.php b/inc/parserutils.php
index 9b2d99328..84aaebb4e 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -682,10 +682,15 @@ function p_get_first_heading($id, $render=true){
if(count($pages) != count($titles)){
$titles = array_fill(0,count($pages),'');
@unlink($conf['indexdir'].'/title.idx'); // will be rebuilt in inc/init.php
+ } else {
+ if (!empty($pages)) // array_combine throws a warning when the parameters are empty arrays
+ $title_index = array_combine($pages, $titles);
+ else
+ $title_index = array();
}
- $title_index = array_combine($pages, $titles);
}
- return $title_index[$id];
+ if (!empty($title_index)) // don't use the index when it obviously isn't working
+ return $title_index[$id];
}
++$count;