[pmwiki-users] Fatal error: [] operator not supported for strings

dso dso at moosoft.com
Sun Oct 29 10:27:46 CST 2006


I figured out the problem with this.  The examples from
http://www.pmwiki.org/wiki/Cookbook/SearchPatterns
have some with ['variable'][] and some without the trailing [].
The trailing [] is only needed apparently when more than one item is
added to the array.  So the first item is fine without it but the next
item errors.

The solution is to use the trailing [] on all entries.

This now showing my cleaned up search results! yay!

//don't show pages that reference themselves
$SearchPatterns['default'][] = FmtPageName('!^$Group\\.$Name$!', $pagename);
//hide the PmWiki library and Site entries
$SearchPatterns['default'][] = '!^(PmWiki|Site)\.!';
//hide WikiSandbox
$SearchPatterns['default'][] = '!\\.(WikiSandbox)$!';
//hide RecentChanges, AllChanges and Uploads
$SearchPatterns['default'][] = '!\\.(All)?Recent(Changes|Uploads)$!';
//hide group headers
$SearchPatterns['default'][] = '!\\.Group(Print)?Header$!';

Hope it helps someone else!

dso wrote:
> I couldn't find this particular issue in the archives..
> 
> Fatal error: [] operator not supported for strings in config.php
> 
> $SearchPatterns['default'][] = '!^Site\.!';
> 
> Daniel
> 







More information about the pmwiki-users mailing list