Closes ticket #3080 in CakePHP Lighthouse (http://cakephp.lighthouseapp.com/projects/42648/tickets/3080-hashflatten-endless-loop-on-single-0-int-keys).
Hash::flatten has a bug which causes an endless loop when try to flatten an integer key.
Probably the $data array pointer won't reset itself when doing:

$data = $element

and

list($data, $path) = array_pop($stack)

The solution is to reset the pointer after the assignments.
Add test for recursion issues in Hash::expand().

Refs #3080
Merge branch 'bbcrew-master'

From pull/1062 reset data arrays when expanding to solve
infinite recursion issues in PHP5.2

Fixes #3080
Update version number to 2.2.5
Fix lint errors.
Merge branch 'master' of git://github.com/cakephp/cakephp
Ensure $sources is Array before use
Merge pull request #1069 from radig/master

Ensure $sources is Array ( fix #3520 )
Add OK or Successful HTTP codes 200-206 to HttpResponse::isOK(). Fixes #3531
Merge pull request #1072 from uzyn/httpresponse-3531

Add OK or Successful HTTP codes 200-206 to HttpResponse::isOK().

Fixes #3531
Don't treat tables that substring match as associations

The table structure of:

- packages
- userpackages
- georegions
- userpackages_georegions

Should not create a habtm between packages & georegions.

Fixes #3532
Only bake HABTM associations for tables that exist.

bake often guesses wrong when it comes to habtm. Only add associations
we're highly confident of. This includes tables where the foreign table
also exists.

Refs #3532
Merge branch 'master' of git://github.com/cakephp/cakephp