summaryrefslogtreecommitdiff
path: root/inc/indexer.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2014-03-06 20:05:31 +0000
committerChristopher Smith <chris@jalakai.co.uk>2014-03-06 20:05:31 +0000
commite1ecd6fde3f52e917907ec1dffc774829934d0dd (patch)
treeb7bc78ec9a4cb52b10423a9841fdf1202c7fbe2b /inc/indexer.php
parenta96178004fc8b519df17f6cb907e1c067b964bb2 (diff)
downloadrpg-e1ecd6fde3f52e917907ec1dffc774829934d0dd.tar.gz
rpg-e1ecd6fde3f52e917907ec1dffc774829934d0dd.tar.bz2
resolve notices generated in calls to updateTuple() when $metaidx[$id] doesn't exist
Diffstat (limited to 'inc/indexer.php')
-rw-r--r--inc/indexer.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 7c0b8bc18..a167db47f 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -270,8 +270,9 @@ class Doku_Indexer {
// Special handling for titles so the index file is simpler
if (array_key_exists('title', $key)) {
$value = $key['title'];
- if (is_array($value))
+ if (is_array($value)) {
$value = $value[0];
+ }
$this->saveIndexKey('title', '', $pid, $value);
unset($key['title']);
}
@@ -299,8 +300,10 @@ class Doku_Indexer {
if ($val !== "") {
$id = array_search($val, $metawords, true);
if ($id === false) {
+ // didn't find $val, so we'll add it to the end of metawords and create a placeholder in metaidx
$id = count($metawords);
$metawords[$id] = $val;
+ $metaidx[$id] = '';
$addwords = true;
}
// test if value is already in the index