Donncha, why are you using apache_request_headers() function instead of $_SERVER['HTTP_USER_AGENT'] in wp_cache_user_agent_is_rejected()? apache_request_headers() is not available for all SAPIs.