...

View Full Version : PHP errors on an SMF forum



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!

_Aerospace_Eng_
01-14-2012, 07:19 PM
Just before this

if (!is_array($permission) && in_array($permission, $user_info['permissions']))
add this

echo is_array($permission).'<br>'.
print_r($user_info['permissions']);
Then post the results. I'm guessing $user_info['permissions'] is empty.

doublerainbow
01-17-2012, 07:25 PM
I actually am not getting this error anymore, even though I never applied this fix. I don't know if it was something else that got fixed--I'm also troubleshooting on SMF forums for this stuff, I have hundreds of errors and have not been yet able to find anyone to fix them. The error could still reappear, but when I tried a fix on this file the last time it screwed up permissions for everybody. It's very dangerous. The forum has a few thousand people on it.

Thank you very much and I will get back to you. I do have a few other errors popping up frequently right now.

All right. I have so many errors. These are the critical ones listed among the hundreds of others:



suncat
Apply Filter: Only show the error messages of this IP address 50.xx
Reverse chronological order of list Today at 03:06:21 PM
Apply Filter: Only show the error messages of this session 6598ce136733de7e38a377d4c2b178ed
Apply Filter: Only show the errors of this type Type of error: Critical
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=findmember;cdb07c2338=6598ce136733de7e38a377d4c2b178ed
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Array of integers expected. (buddy_list)
Function: findMembers
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Subs-Auth.php
Line: 511

Apply Filter: Only show the error messages of this member KittySuperSaiyan410
Apply Filter: Only show the error messages of this IP address 24.xx
Reverse chronological order of list Yesterday at 08:57:35 PM
Apply Filter: Only show the error messages of this session cbd25175c765d8ac8b938bf4a6ae1cb7
Apply Filter: Only show the errors of this type Type of error: Critical
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=pm;sa=pmactions;f=inbox;start=0;conversation=
Apply Filter: Only show the errors with the same message
Database error, given array of integer values is empty. (pm_heads)
Function: MessageActionsApply
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/PersonalMessage.php
Line: 2368

Apply Filter: Only show the error messages of this member KittySuperSaiyan410
Apply Filter: Only show the error messages of this IP address 24.xx
Reverse chronological order of list Yesterday at 08:57:29 PM
Apply Filter: Only show the error messages of this session cbd25175c765d8ac8b938bf4a6ae1cb7
Apply Filter: Only show the errors of this type Type of error: Critical
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=pm;sa=pmactions;f=inbox;start=0;conversation=
Apply Filter: Only show the errors with the same message
Database error, given array of integer values is empty. (pm_heads)
Function: MessageActionsApply
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/PersonalMessage.php
Line: 2368

Apply Filter: Only show the error messages of this member ~•◘○Bloodstripe○◘•~
Apply Filter: Only show the error messages of this IP address 184.xx
Reverse chronological order of list Yesterday at 10:55:13 AM
Apply Filter: Only show the error messages of this session fa27f75f38a85722e638f2976b7ace02
Apply Filter: Only show the errors of this type Type of error: Critical
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=findmember;da5ea5d=fa27f75f38a85722e638f2976b7ace02
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Array of integers expected. (buddy_list)
Function: findMembers
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Subs-Auth.php
Line: 511


I don't know what to do. I do not really know PHP at all and we're having daily crises with all this. There's more, a LOT more. I think I need somebody to do a top to bottom workover fixing my forum's bugs.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum