Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2011
    Posts
    38
    Thanks
    4
    Thanked 0 Times in 0 Posts

    PHP errors on an SMF forum

    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:

    Code:
    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:

    PHP Code:
            if (!is_array($permission) && in_array($permission$user_info['permissions'])) 
    Here is the chunk of code that it is inside of:

    PHP Code:

    // 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!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Just before this
    PHP Code:
    if (!is_array($permission) && in_array($permission$user_info['permissions'])) 
    add this
    PHP Code:
    echo is_array($permission).'<br>'.
    print_r($user_info['permissions']); 
    Then post the results. I'm guessing $user_info['permissions'] is empty.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Apr 2011
    Posts
    38
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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:

    Code:
    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.
    Last edited by doublerainbow; 01-17-2012 at 10:55 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •