Skip to content
Snippets Groups Projects
Commit fe537d1f authored by Matthias Schulte's avatar Matthias Schulte
Browse files

Merge remote branch 'upstream/master'

parents 02901e5a 65f40513
No related branches found
No related tags found
No related merge requests found
...@@ -682,10 +682,15 @@ function p_get_first_heading($id, $render=true){ ...@@ -682,10 +682,15 @@ function p_get_first_heading($id, $render=true){
if(count($pages) != count($titles)){ if(count($pages) != count($titles)){
$titles = array_fill(0,count($pages),''); $titles = array_fill(0,count($pages),'');
@unlink($conf['indexdir'].'/title.idx'); // will be rebuilt in inc/init.php @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; ++$count;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment