Last modified: 2007-08-27 18:57:25 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 T13082, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11082 - Wrong order of arguments for strpos in function tableName
Wrong order of arguments for strpos in function tableName
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


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

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.


Navigation
Links