Update Hash.php

I'm not sure on whether this is a problem with my local app but I have seen it a couple of times in a couple of projects: 
Warning (2): Invalid argument supplied for foreach() [CORE/Cake/Utility/Hash.php, line 52]

I think Hash::get should be able to handle this better rather than throwing an error in a core Util file.
I know it should be - but if a malformed array is passed to it then it
fires off PHP Warnings, if this is possible then the code should handle
this condition. I think in my case it is because of some session wrangling
that happens:

'Config' => array(
		'userAgent' => 'e8ef8a8090579924d3240bc864eee195',
		'time' => (int) 1408069152,
		'countdown' => (int) 10
	),
'UserAuth' => array(
	(int) 0 => null, << here I guess
	'User' => array(



On 20 June 2014 12:09, Mark Story <notifications@github.com> wrote:

> In lib/Cake/Utility/Hash.php:
>
> > @@ -50,11 +50,14 @@ public static function get(array $data, $path, $default = null) {
> >  		} else {
> >  			$parts = $path;
> >  		}
> > -		foreach ($parts as $key) {
>
> How/when is parts not an array?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/cakephp/cakephp/pull/3754/files#r14004609>.
>



-- 
__
Mob: (+61) 0481 301 640
Skype: daniel.voyce
Twitter: www.twitter.com/voycey