Re: Problem after upgrade PHP 5 with array-merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PHP Question wrote:
> After my provider decided to upgrade PHP to version 5, i'm getting the
> following error:
>
> Warning: array_merge() [function.array-merge]: Argument #2 is not an
> array.
>
> This is the line where it gets stuck:
>
> $_SESSION['aanhefmr'] = array_merge($_SESSION['aanhefmr'],
> $_POST['aanhefmr']);
>
> How can i convert it properly to PHP 5? I've wrote this two years ago.. So
> my mind let me down a little.

$_SESSION[''aanhefmr'] = array_merge($_SESSION['aanhefmr'],
is_array($_POST['aanhefmr']) ? $_POST['aanhefmr'] : array());

This seems kinda dangerous to me, just blindly stuffing all POST data into
SESSION data, though...

Hopefully you sanitize it elsewhere...

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux