Page MenuHomePhabricator

displays warning array_key_exists() on top of the page.
Closed, ResolvedPublic

Description

Author: quentinjs

Description:
Warning: array_key_exists(): The first argument should be either a string or an
integer in C:\Inetpub\www.ZoomnQRacing.com\PowerBook\includes\User.php on line 128


Version: 1.3.x
Severity: normal
OS: Windows 2000
Platform: PC
URL: http://www.ZoomnQRacing.com/PowerBook

Details

Reference
bz506

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 7:07 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz506.
bzimport added a subscriber: Unknown Object (MLST).

jeluf wrote:

Can't see a warning at the specified URL. Where does it show the warning?

quentinjs wrote:

From the main page, press edit. (In reply to comment #0)

Warning: array_key_exists(): The first argument should be either a string or an
integer in C:\Inetpub\www.ZoomnQRacing.com\PowerBook\includes\User.php on line 128

wmahan_04 wrote:

The line in question in 1.3.3 is

if ( array_key_exists( $wgIP, $wgProxyList ) ) {

$wgIP is supposed to be set from the REMOTE_ADDR environment variable in
Setup.php. It appears that for some reason it is not.

tthompson wrote:

http://us2.php.net/getenv says this:

Note: This function does not work in ISAPI mode.

I have my IIS server running ISAPI mode, and get this bug. Perhaps occurrances of getenv()
should use $_SERVER[''] instead.

WORKAROUND: Change Setup.php as follows, line 35:

$wgIP = $_SERVER['REMOTE_ADDR'];

Additional use of getenv() include the following:
includes/DefaultSettings.php
includes/Parser.php
irc/rc2irc.php

wmahan_04 wrote:

Thanks for getting to the bottom of this, Troy. I've fixed this in HEAD, and the
change can be made in REL1_3 if no problems turn up.

tthompson wrote:

(In reply to comment #5)

Thanks for getting to the bottom of this, Troy. I've fixed this in HEAD, and the
change can be made in REL1_3 if no problems turn up.

Just installed the latest version 1.3.6 and the problem is still there. Maybe
I'll report this bug again for the new release.

  • Bug 720 has been marked as a duplicate of this bug. ***

wmahan_04 wrote:

Committed the fix to REL1_3; it will be in the next release.

quentinjs wrote:

as of 1.3.7 this problem still exists.

1.3.7 predates the fix being committed, so it's expected that it would not contain the fix. The described fix is present in 1.3.8,
1.3.9, and the 1.4 betas.

Resolving as FIXED pending further details.