Results 1 to 9 of 9
Hybrid View
-
3rd Feb 2012, 08:53 AM #1OPBanned
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 = max( 1, intval( $value ) );
break;
case "boolean" :
$value = $bool_as_int ? $value ? 1 : 0 : $value ? true : false;
break;
case "bitfield" :
do
{
if ( !is_array( $value ) )
{
break;
}
else
{
$bitfield = 0;
foreach ( $value as $bitval )
{
$bitfield += $bitval;
}
$value = $bitfield;
}
} while ( 0 );
$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_string( htmlspecialchars_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
-
3rd Feb 2012, 10:52 AM #2MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comWhat 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.JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
3rd Feb 2012, 10:57 AM #3Member
This site is using a hacked database of W junction
Last edited by Gavo; 4th Jan 2015 at 02:32 PM.
-
5th Feb 2012, 03:46 AM #4Respected MemberWebsite's:
DL4Everything.com Soft2050.in
-
3rd Feb 2012, 12:17 PM #5(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comlooks 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!
-
3rd Feb 2012, 12:22 PM #6You 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
-
3rd Feb 2012, 12:23 PM #7Member
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
-
4th Feb 2012, 07:07 AM #8OPBanned
i do, i know that error but its like something that cant pass via that function and i cant understand why.
-
4th Feb 2012, 02:29 PM #9MemberWebsite's:
Elite.SO Defendos.com Motionite.comWell 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."
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
PHP Warning
By cyb3r in forum Web Application/Script SupportReplies: 1Last Post: 15th Sep 2011, 12:19 AM -
Ubisoft CEO expects PS3 and Xbox 360 price cuts this year
By ShareShiz in forum News & Current EventsReplies: 4Last Post: 18th Jun 2011, 11:59 AM -
WARNING TO ALL MEN!
By iMage in forum General DiscussionReplies: 23Last Post: 17th May 2010, 04:23 PM -
Warning to ALL @ KWWH.
By SᴩiDᴇЯ in forum General DiscussionReplies: 18Last Post: 19th Nov 2009, 12:43 PM -
A warning.
By Luke in forum General DiscussionReplies: 3Last Post: 25th Aug 2009, 03:11 AM
themaCreator - create posts from...
Version 3.47 released. Open older version (or...