Author: rhaertel80
Description:
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.
Version: unspecified
Severity: normal
Attached: