Changed magic_quotes_gpc handling to require PHP 5.2.8 and use the fixes introduced there, closes #953