So, I was making some modifications in order to allow for three things: Capitalization in page names, natural case sorting in the sidebar ToC, and case insensitive search.
Bear with me, because I know this looks like a file permissions error. I do not believe it is.
Upon searching for "nul" and any variation of that(nUl, Nul, nuL, etc), I receive the following error message:
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 365
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 366
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 367
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 368
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 369
Warning: filesize() [function.filesize]: stat failed for C:/Websites/dokuwiki/data/meta/nul.changes in C:\Websites\dokuwiki\inc\changelog.php on line 305
There is not and never has been a page named "nul." Once the search has completed, it adds a new line to \dokuwiki\data\index\page.idx with the same content as what I searched for(nul, NuL, nUl, etc, etc). Once that line has been added to page.idx, any search for the letters "n" "u" or "l" will also result in an error:
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 365
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 366
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 367
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 368
Warning: Cannot unset offset in a non-array variable in C:\Websites\dokuwiki\inc\parserutils.php on line 369
Warning: filectime() [function.filectime]: stat failed for C:/Websites/dokuwiki/data/pages/nul.txt in C:\Websites\dokuwiki\inc\parser\metadata.php on line 46
Warning: filemtime() [function.filemtime]: stat failed for C:/Websites/dokuwiki/data/pages/nul.txt in C:\Websites\dokuwiki\inc\parser\metadata.php on line 72
Once again, the page "nul" has not ever existed on the wiki and is being written to page.idx upon searching.
Here are the modifications I made to achieve the three things I noted in the beginning of my post:
/inc/fulltext.php, lines 255 and 263: I replaced "strpos" with "stripos."
if ($id !== '' && $cleaned !== '') {
foreach ($pages as $p_id => $p_title) {
if ((stripos($in_ns ? $p_id : noNSorNS($p_id), $cleaned) === false) &&
(!$in_title || (stripos($p_title, $id) === false)) ) {
unset($pages[$p_id]);
}
}
}
if (isset($ns)) {
foreach (array_keys($pages) as $p_id) {
if (stripos($p_id, $ns) !== 0) {
unset($pages[$p_id]);
}
}
}
/inc/pageutils.php, line 114 removed:
//$id = utf8_strtolower($id);
/inc/search.php, lines 40 and 41: I replaced "sort" with "natcasesort"
natcasesort($files);
natcasesort($dirs);
These are all minor changes as far as I can tell, and I don't see anything immediately apparent that would be causing this issue.
Any ideas?