<?php
/*
Plugin Name: PHP Floating Point DoS Attack Workaround
Version: 0.1
Plugin URI: http://core.trac.wordpress.org/ticket/16097
Description: Prevents 32-bit PHP version from hanging when processing a request with 2.2250738585072011e-308 value.
Author: AirCraft24.com, Sergey Biryukov
*/

if ( $_REQUEST ) {
	while ( list( $key, $value ) = each( $_REQUEST ) ) {
		$value = str_replace( '.', '', $value );
		if ( preg_match( '/22250738585072011[0]*e/i', $value ) ) {
			unset( $_REQUEST[$key] );
			unset( $_GET[$key] );
			unset( $_POST[$key] );
			unset( $_COOKIE[$key] );
			$GLOBALS[$key] = '';
		}
	}
	reset( $_REQUEST );
}
?>