Last modified: 2007-08-27 18:57:25 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 11082 - Wrong order of arguments for strpos in function tableName
Wrong order of arguments for strpos in function tableName
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-08-27 18:31 UTC by Robbie Haertel
Modified: 2007-08-27 18:57 UTC (History)
0 users

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

Patch to swap the order of the arguments to strpos (684 bytes, patch)
2007-08-27 18:31 UTC, Robbie Haertel

Description Robbie Haertel 2007-08-27 18:31:02 UTC
Created attachment 4046 [details]
Patch to swap the order of the arguments to strpos

I wrote an install script for my own MediaWiki extension based mostly on the install.php of the bad image list extension. However, when I run it I get the following error:

Warning: strpos(): Empty delimiter. in /home/rah67/workspaces/MayaWiki Workspace/MayaWiki/includes/Database.php on line 1586

There is no call to strpos() on line 1586 (rev 25203; last changed revision of Database.php was 24969). However, there is a call on the previous line (1585):

if ( $this->mTablePrefix !== '' &&  strpos( $name, '.' ) === false ) { ... }

Note that the PHP documentation defines strpos like this:

int strpos ( string $haystack, mixed $needle [, int $offset] )

It appears, therefore, that the order of the arguments are reversed on line 1585. When I swap them, the code runs without warning.
Comment 1 Brion Vibber 2007-08-27 18:57:25 UTC
Congratulations, that's been broken since July 2004. :)

Fixed in r25204

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