Removing the white spaces from a string is a easy task, but for doing this in whole of you website you need the recursive function in Cakephp
The 'array_walk_recursive()' will recursively get the request(GET/PUT) data and remove the white/blank spaces
for example
if ($this->request->is('post') || $this->request->is('put')) {
array_walk_recursive($this->request->data, array($this, 'trimArray'));
}
// Remove white spaces from start and end of a string from element
public function trimArray(&item, &key)
{
$item = trim($item);
}
Now your all request data will have zero white spaces
0 Comment(s)