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 #74719 Allow NULL as context, testing fopen, rename, unlink, mkdir and rmdir ..

Decoded Output download

--TEST--
Bug #74719 Allow NULL as context, testing fopen, rename, unlink, mkdir and rmdir
--CREDITS--
Alexander Holman <[email protected]>
--FILE--
<?php

// fopen
$tmpFile = __DIR__ . "/bug74719.tmp";
$h = fopen($tmpFile, "w", false, NULL);
if ($h !== false) {
    echo "ok
";
    fclose($h);
}

$newTmpFile = __DIR__ . "/bug74719_renamed.tmp";
if (rename($tmpFile, $newTmpFile, NULL)) {
    echo "ok
";
}

if (unlink($newTmpFile, NULL)) {
    echo "ok
";
}

$tmpDir = __DIR__ . "/bug74719_dir";

if (mkdir($tmpDir, 0777, false, NULL)) {
    echo "ok
";
}

if (rmdir($tmpDir, NULL)) {
    echo "ok
";
}

?>
--EXPECT--
ok
ok
ok
ok
ok

Did this file decode correctly?

Original Code

--TEST--
Bug #74719 Allow NULL as context, testing fopen, rename, unlink, mkdir and rmdir
--CREDITS--
Alexander Holman <[email protected]>
--FILE--
<?php

// fopen
$tmpFile = __DIR__ . "/bug74719.tmp";
$h = fopen($tmpFile, "w", false, NULL);
if ($h !== false) {
    echo "ok\n";
    fclose($h);
}

$newTmpFile = __DIR__ . "/bug74719_renamed.tmp";
if (rename($tmpFile, $newTmpFile, NULL)) {
    echo "ok\n";
}

if (unlink($newTmpFile, NULL)) {
    echo "ok\n";
}

$tmpDir = __DIR__ . "/bug74719_dir";

if (mkdir($tmpDir, 0777, false, NULL)) {
    echo "ok\n";
}

if (rmdir($tmpDir, NULL)) {
    echo "ok\n";
}

?>
--EXPECT--
ok
ok
ok
ok
ok

Function Calls

None

Variables

None

Stats

MD5 bfe75120256bf0cd85d8a0ddc9bbff2b
Eval Count 0
Decode Time 90 ms