Akismet Sanitised

I made the Akismet plugin a little more sane after discovering it sent the entire $_SERVER array to akismets servers. I changed:

        $ignore = array( 'HTTP_COOKIE' );

        foreach ( $_SERVER as $key => $value )
                if ( !in_array( $key, $ignore ) )
                        $comment["$key"] = $value;

To:

        foreach ($_SERVER as $k => $v)
        {
                if (strpos($k, 'HTTP_') === 0 && $k != 'HTTP_COOKIE')
                {
                        $comment[$k] = $v;
                }
        }

Leave a Reply