Last modified: 2010-05-15 15:51:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 10166 - bug in Language.php function getMagic
bug in Language.php function getMagic
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: 10204 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2007-06-06 03:44 UTC by Nate Lallouche
Modified: 2010-05-15 15:51 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Nate Lallouche 2007-06-06 03:44:25 UTC
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.

Comment 1 Rob Church 2007-06-11 06:40:19 UTC
*** Bug 10204 has been marked as a duplicate of this bug. ***
Comment 2 Raimond Spekking 2007-12-06 22:17:19 UTC
Fixed with r28224.

Note You need to log in before you can comment on or make changes to this bug.