Fixed wrong handling with _per_page and _page datagrid parameters in php 5.3

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #2292, #2288, #2313, #2335
| License       | MIT

This PR is using fix from issue #2313 created by @Geckow