Introducing General::intval()

This method will insure that we are really dealing with a positive integer before trying to cast it.

This should eliminate nasty side effects like casting '1234a' to 1234.
Use General::intval to cast system:id

This will make it safer and should fix #2191
Added Status 302 header in redirect()

I do not know why, but without it, my setup was returning a 500 code if the actual http status was something else (404 in my case).

This fix only makes sure that the 302 status (temporary redirect) will be returned to the client.
After all, a call to redirect must really mean that we want a redirect.

Note: I did not used the Page class helpers since this is 'utility' code and I did not wanted to couple utility code to the Page class.
Better logic for handling http status codes

This change makes the error handler a little bit more smarter in the sense that it will try to extract the http status code from the exception it receives. If not status is found, then it reverts to the original implementation that was returning a 500.
Fixed #2212
Merge pull request #2213 from jensscherbl/integration

Check the value of the HTML Encode setting rather than just it's existence. Fixes #2212.
Allow handling of post request's that exceed the server limit. Closes #1187
Release 2.5.2-beta.1
Various fixes as discovered with scrutinizer
Additional scrutinizer fixes
Couple more tweaks for AjaxDocumentation class
Fixed accidental output
Merge pull request #2222 from jensscherbl/integration

Fixed accidental output
Merge pull request #2199 from DeuxHuitHuit/redirect

Make the Error Handler smarter setting HTTP Status. Additionally send 302 Redirect in the redirect() utility function.
Merge pull request #2195 from DeuxHuitHuit/issue-2191

Filtering on the `system:id` using an invalid value will now return nothing instead of casting it blindly to an ID. Fixes #2191
Some cleanup of the Pages Editor
Simplify some of the backend page alerts.
Ensure prepopulation parameters persist even if an error occurs on initial entry creation. Fixes #2211
There isn't any need to use Reflection to get Event/Datasource data