doublerainbow
01-14-2012, 03:26 AM
I apologise for not providimng enough info in the past on my problems on my site. Now I am back, and the problems are definitely PHP related.
My site gets them all over the place and one of them is this error:
http://warriorcatsrpg.com/warriors-talk/i-acctully-found-warrior-cats-game-the-game-has-been-shut-66304.0.html.
2: in_array() expects parameter 2 to be array, null given
File: /home/warrior/public_html/Sources/Security.php
Line: 837
What does in array expects parameter 2 to be array, null given, mean? How do I fix this?
Here is line 837:
if (!is_array($permission) && in_array($permission, $user_info['permissions']))
Here is the chunk of code that it is inside of:
// Check the user's permissions.
function allowedTo($permission, $boards = null)
{
global $user_info, $modSettings, $smcFunc;
// You're always allowed to do nothing. (unless you're a working man, MR. LAZY :P!)
if (empty($permission))
return true;
// You're never allowed to do something if your data hasn't been loaded yet!
if (empty($user_info))
return false;
// Administrators are supermen :P.
if ($user_info['is_admin'])
return true;
// Are we checking the _current_ board, or some other boards?
if ($boards === null)
{
// Check if they can do it.
if (!is_array($permission) && in_array($permission, $user_info['permissions']))
return true;
// Search for any of a list of permissions.
elseif (is_array($permission) && count(array_intersect($permission, $user_info['permissions'])) != 0)
return true;
// You aren't allowed, by default.
else
return false;
}
elseif (!is_array($boards))
$boards = array($boards);
I hope that this helps. Thanks to anyone who can help me!
My site gets them all over the place and one of them is this error:
http://warriorcatsrpg.com/warriors-talk/i-acctully-found-warrior-cats-game-the-game-has-been-shut-66304.0.html.
2: in_array() expects parameter 2 to be array, null given
File: /home/warrior/public_html/Sources/Security.php
Line: 837
What does in array expects parameter 2 to be array, null given, mean? How do I fix this?
Here is line 837:
if (!is_array($permission) && in_array($permission, $user_info['permissions']))
Here is the chunk of code that it is inside of:
// Check the user's permissions.
function allowedTo($permission, $boards = null)
{
global $user_info, $modSettings, $smcFunc;
// You're always allowed to do nothing. (unless you're a working man, MR. LAZY :P!)
if (empty($permission))
return true;
// You're never allowed to do something if your data hasn't been loaded yet!
if (empty($user_info))
return false;
// Administrators are supermen :P.
if ($user_info['is_admin'])
return true;
// Are we checking the _current_ board, or some other boards?
if ($boards === null)
{
// Check if they can do it.
if (!is_array($permission) && in_array($permission, $user_info['permissions']))
return true;
// Search for any of a list of permissions.
elseif (is_array($permission) && count(array_intersect($permission, $user_info['permissions'])) != 0)
return true;
// You aren't allowed, by default.
else
return false;
}
elseif (!is_array($boards))
$boards = array($boards);
I hope that this helps. Thanks to anyone who can help me!