Re: Problem after upgrade PHP 5 with array-merge

From: Date: Mon, 24 Jan 2005 20:51:45 +0000
Subject: Re: Problem after upgrade PHP 5 with array-merge
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-207168@lists.php.net to get a copy of this message
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

« previous php.general (#207168) next »