Page MenuHomePhabricator

Warning got in includes/Title.php
Closed, ResolvedPublic

Description

Author: fourat

Description:

Got this warning:

<b>
Warning
</b>
: in_array() [
<a href="function.in-array">
function.in-array
</a>
]: Wrong datatype for second argument in
<b>
/var/www/TriKi/includes/Title.php
</b>
on line
<b>
1306

</b>

Steps to reproduce:
Created new groups in LocalSettings.php, and tryed to affect a User one of the new available groups.

A temporary (?) correction i can make is:

1306c1306

< if( ( is_array($wgWhitelistRead) ) && ( in_array( $pure, $wgWhitelistRead, true ) ) )

> if( in_array( $pure, $wgWhitelistRead, true ) )


Version: 1.11.x
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz11801

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 9:55 PM
bzimport set Reference to bz11801.
bzimport added a subscriber: Unknown Object (MLST).

This seems to be resolved in 1.12 branch (trunk); Title::userCanRead() has been restructured a bit, and the func will bail out earlier if the whitelist isn't an array (eg left as default 'false').

ian wrote:

When confirming e-mail address for the 1st time in a new install of mediaWiki 1.11.0 a message was displayed saying that there was a type mismatch in argument 2 of a function call on line 1306 of includes/Title.php

if( in_array( $pure, $wgWhitelistRead, true ) )

There were no discernable ill-effects so far, the e-mail address was verified OK.

I think this is similar to the above bug but might be worth quick check that the earlier baleout will catch this too?

...Ian.

(In reply to comment #2)

When confirming e-mail address for the 1st time in a new install of mediaWiki
1.11.0 a message was displayed saying that there was a type mismatch in
argument 2 of a function call on line 1306 of includes/Title.php

if( in_array( $pure, $wgWhitelistRead, true ) )

You should set $wgWhitelistRead = array(); in LocalSettings.php to get rid of that warning.

The default value is false to disable it.

Note that the bug was fixed in 1.12 with the reordering of various checks.