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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T12166, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10166 - bug in Language.php function getMagic
bug in Language.php function getMagic
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
1.10.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 10204 (view as bug list)
Depends on:
Blocks:
  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: ---


Attachments

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.

Thanks,
Nate
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.


Navigation
Links