Activity Stream
48,167 MEMBERS
6889 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 9 of 9
  1.     
    #1
    Banned

    Default Need little help: Warning: trim() expects parameter 1

    Warning: trim() expects parameter 1 to be string, array given in [path]\includes\lnk_chck\admcp\adminfunctions.php on line 429

    line 429 in that function is $value = trim( $value );

    any solution how to fix ?

    function:
    PHP Code: 
    function validate_value( &$value$datatype$bool_as_int true$username_query true )
    {
        global 
    $vbulletin;
        switch ( 
    $datatype )
        {
        case 
    "number" :
            
    $value += 0;
            break;
        case 
    "integer" :
            
    $value intval$value );
            break;
        case 
    "arrayinteger" :
            
    $key array_keys$value );
            
    $size sizeOf$key );
            
    $i 0;
            while ( 
    $i $size )
            {
                
    $value[$key[$i]] = intval$value[$key[$i]] );
                ++
    $i;
            }
            break;
        case 
    "arrayfree" :
            
    $key array_keys$value );
            
    $size sizeOf$key );
            
    $i 0;
            while ( 
    $i $size )
            {
                
    $value[$key[$i]] = trim$value[$key[$i]] );
                ++
    $i;
            }
            break;
        case 
    "posint" :
            
    $value max1intval$value ) );
            break;
        case 
    "boolean" :
            
    $value $bool_as_int $value $value true false;
            break;
        case 
    "bitfield" :
            do
            {
                if ( !
    is_array$value ) )
                {
                    break;
                }
                else
                {
                    
    $bitfield 0;
                    foreach ( 
    $value as $bitval )
                    {
                        
    $bitfield += $bitval;
                    }
                    
    $value $bitfield;
                }
            } while ( 
    );
            
    $value += 0;
            break;
        case 
    "username" :
            
    $value trim$value );
            if ( 
    $username_query )
            {
                if ( empty( 
    $value ) )
                {
                    
    $value 0;
                }
                else if ( 
    $userinfo $vbulletin->db->query_first"SELECT userid FROM ".TABLE_PREFIX."user WHERE username = '".$vbulletin->db->escape_stringhtmlspecialchars_uni$value ) )."'" ) )
                {
                    
    $value $userinfo['userid'];
                }
                else
                {
                    
    $value false;
                }
            }
            break;
        default :
            
    $value trim$value );
        }
        return 
    $value;

    devNULL Reviewed by devNULL on . Need little help: Warning: trim() expects parameter 1 Warning: trim() expects parameter 1 to be string, array given in \includes\lnk_chck\admcp\adminfunctions.php on line 429 line 429 in that function is $value = trim( $value ); any solution how to fix ? function: function validate_value( &$value, $datatype, $bool_as_int = true, $username_query = true ) { global $vbulletin; Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    tehMoviez.com 0Senes.com GeekFaceGames.com
    What is exactly line 429, is it under default or username?
    And the best way to detect errors is to var_dump $value under each of these two lines above.

  4.     
    #3
    Member
    This site is using a hacked database of W junction
    Last edited by Gavo; 4th Jan 2015 at 02:32 PM.

  5.     
    #4
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    looks like hes passing an array which should be a string, but im not sure.
    Projects:
    WCDDL - The Professional DDL Script
    Top Secret Project: In Development - ZOMG
    ImgTrack - Never Have Dead Images Again!

  6.     
    #5
    You can call me G
    try doing var_dump($value); die();

    just above the line that causes the error.. and then proceed with debugging..



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  7.     
    #6
    Member
    I saw in other threads that you do php things. I can't believe that you don't understand:
    expects parameter 1 to be string, array given

  8.     
    #7
    Banned
    i do, i know that error but its like something that cant pass via that function and i cant understand why.

  9.     
    #8
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    Well I can translate it for you "expects parameter 1 to be string, array given" means "You are passing an array, but it requires a string. So please god dammit pass me the string."

    Defendos BETA3 Released! Thread - Official Website

  10.     
    #9
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Quote Originally Posted by Gavo View Post
    PHP Code: 
    function validate_value( &$value
    remove the &
    I don't think so. He is passing the value by reference.

    Quote Originally Posted by devNULL View Post
    i do, i know that error but its like something that cant pass via that function and i cant understand why.
    Paste the lines where you are using this function if this isn't still fixed.
    The problem is likely the same as above told.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP Warning
    By cyb3r in forum Web Application/Script Support
    Replies: 1
    Last Post: 15th Sep 2011, 12:19 AM
  2. Ubisoft CEO expects PS3 and Xbox 360 price cuts this year
    By ShareShiz in forum News & Current Events
    Replies: 4
    Last Post: 18th Jun 2011, 11:59 AM
  3. WARNING TO ALL MEN!
    By iMage in forum General Discussion
    Replies: 23
    Last Post: 17th May 2010, 04:23 PM
  4. Warning to ALL @ KWWH.
    By SᴩiDᴇЯ in forum General Discussion
    Replies: 18
    Last Post: 19th Nov 2009, 12:43 PM
  5. A warning.
    By Luke in forum General Discussion
    Replies: 3
    Last Post: 25th Aug 2009, 03:11 AM

Tags for this Thread

BE SOCIAL