Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #61679 (Error on non-standard HTTP methods) --SKIPIF-- <?php include "skipif...

Decoded Output download

--TEST--
Bug #61679 (Error on non-standard HTTP methods)
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start(<<<'PHP'
echo "This should never echo";
PHP
);

$host = PHP_CLI_SERVER_HOSTNAME;
$fp = php_cli_server_connect();

// Send a request with a fictitious request method,
// I like smurfs, the smurf everything.
if(fwrite($fp, <<<HEADER
SMURF / HTTP/1.1
Host: {$host}


HEADER
)) {
    while (!feof($fp)) {
        echo fgets($fp);
        // Only echo the first line from the response,
        // the rest is not interesting
        break;
    }
}

fclose($fp);
?>
--EXPECT--
HTTP/1.1 501 Not Implemented

Did this file decode correctly?

Original Code

--TEST--
Bug #61679 (Error on non-standard HTTP methods)
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start(<<<'PHP'
echo "This should never echo";
PHP
);

$host = PHP_CLI_SERVER_HOSTNAME;
$fp = php_cli_server_connect();

// Send a request with a fictitious request method,
// I like smurfs, the smurf everything.
if(fwrite($fp, <<<HEADER
SMURF / HTTP/1.1
Host: {$host}


HEADER
)) {
    while (!feof($fp)) {
        echo fgets($fp);
        // Only echo the first line from the response,
        // the rest is not interesting
        break;
    }
}

fclose($fp);
?>
--EXPECT--
HTTP/1.1 501 Not Implemented

Function Calls

None

Variables

None

Stats

MD5 e0a25afd193143267b64860baa2fb104
Eval Count 0
Decode Time 86 ms