Riadok 438:
$value = trim( $value );
Chyba:
Kód:
Warning: trim() expects parameter 1 to be string, array given in [path]\includes\ai\adminfunctions.php on line 438
Funkcia v ktorej je chyba:
Kód:
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;
}