Author: spamfree
Description:
Trying to upgrade my wiki to version 1.10.0 I have come up with several of these ugly warning messages:
Warning: array_slice() [function.array-slice]: The first argument should be an array in /home/astrolo4/public_html/astrology/w/languages/Language.php on line 1139
I tracked it to the getMagic function. Apparently the ParserFunctions extension was establishing $wgParser->setFunctionHook's, some of which had no associated magicWord assigned to them. The getMagic function apparently has no exception handling for this kind of situation.
I have fixed things in ParserFunctions, but maybe the dev guys would find it appropriate to condition the assignment of $rawEntry to $mw->mSynonyms upon the previous 'if' not bearing out, i.e.:
if( !is_array( $rawEntry ) ) {
error_log( "\"$rawEntry\" is not a valid magic thingie for \"$mw->mId\"" );
} else { // <<<<<<<<<
$mw->mCaseSensitive = $rawEntry[0];
$mw->mSynonyms = array_slice( $rawEntry, 1 );
}
I have also reported the ParserFunctions bug appropriately.
Thanks,
Nate
Version: 1.10.x
Severity: normal