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-- Basic long path test with file I/O --SKIPIF-- <?php include __DIR__ . DIRECTORY_S..

Decoded Output download

--TEST--
Basic long path test with file I/O
--SKIPIF--
<?php
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";

skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");

?>
--FILE--
<?php

$p = "";
$s = str_repeat('a', 50);
$how_many = 32;


for ($i = 0; $i < $how_many; $i++) {
    $p .= "$s";
    $p .= DIRECTORY_SEPARATOR;
}

$p = realpath(__DIR__) . DIRECTORY_SEPARATOR . $p;

echo strlen($p), "
", $p, "
";


var_dump(mkdir($p, 0777, true));
var_dump(file_exists($p));

$p7 = $p . "hello.txt";

file_put_contents($p7, "hello");
var_dump(file_get_contents($p7));

unlink($p7);

for ($i = 0; $i < $how_many; $i++) {
    $p0 = substr($p, 0, strlen($p) - $i*51);
    rmdir($p0);
}

var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s));

?>
--EXPECTF--
%d%d%d%d
%saaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabool(true)
bool(true)
string(5) "hello"
bool(false)

Did this file decode correctly?

Original Code

--TEST--
Basic long path test with file I/O
--SKIPIF--
<?php
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";

skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");

?>
--FILE--
<?php

$p = "";
$s = str_repeat('a', 50);
$how_many = 32;


for ($i = 0; $i < $how_many; $i++) {
    $p .= "$s";
    $p .= DIRECTORY_SEPARATOR;
}

$p = realpath(__DIR__) . DIRECTORY_SEPARATOR . $p;

echo strlen($p), "\n", $p, "\n";


var_dump(mkdir($p, 0777, true));
var_dump(file_exists($p));

$p7 = $p . "hello.txt";

file_put_contents($p7, "hello");
var_dump(file_get_contents($p7));

unlink($p7);

for ($i = 0; $i < $how_many; $i++) {
    $p0 = substr($p, 0, strlen($p) - $i*51);
    rmdir($p0);
}

var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s));

?>
--EXPECTF--
%d%d%d%d
%s\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaa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