cakephp/cakephp — pull request #4704 by HavokInspiration (2014-09-23 20:11:17+00:00)
Title: Fix Hash::remove() removing data even if the path is not matched

I found an odd behavior with `Hash::remove()`.
Consider this sample of code :

```php
$array = array(
0 => 'foo',
1 => array(
0 => 'baz'
)
);

$results = Hash::remove($array, '{n}.path');
debug($results);
```
I would expect `$results` to be exactly equal to `$array` as the path `'{n}.path'` does not exist in `$array`.
However, this outputs this array :

```php
array(
1 => array(
0 => 'baz'
)
);
```
`Hash::remove()` strips out the first value even if the path is not fully matched.
This PR provides a fix that prevents `Hash::remove()` from removing values in this scenario.
I know a `Hash::check($array, '{n}.path')` does the trick and should prevent this kind of thing from happening but I think this is an unexpected behavior (well at least, it is to me).