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-- Test session_save_path() function : variation --EXTENSIONS-- session --SKIPIF-- <..

Decoded Output download

--TEST--
Test session_save_path() function : variation
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc');?>
--INI--
open_basedir=.
session.save_handler=files
session.save_path=
session.name=PHPSESSID
--FILE--
<?php

ob_start();

echo "*** Testing session_save_path() : variation ***
";
$initdir = __DIR__;
$sessions = ($initdir."/session_save_path_variation4");

chdir($initdir);

// Delete the existing directory
if (file_exists($sessions) === TRUE) {
    @rmdir($sessions);
}

var_dump(mkdir($sessions));
var_dump(chdir($sessions));
ini_set("session.save_path", $initdir);
var_dump(session_save_path());
var_dump(session_start());
var_dump(session_save_path());
var_dump(session_destroy());
var_dump(session_save_path());

echo "Done";
ob_end_flush();
?>
--CLEAN--
<?php
$initdir = __DIR__;
$sessions = ($initdir."/session_save_path_variation4");
var_dump(rmdir($sessions));
?>
--EXPECTF--
*** Testing session_save_path() : variation ***
bool(true)
bool(true)

Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
string(0) ""

Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d

Warning: session_start(): Failed to initialize storage module: files (path: ) in %s on line %d
bool(false)
string(0) ""

Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
bool(false)
string(0) ""
Done

Did this file decode correctly?

Original Code

--TEST--
Test session_save_path() function : variation
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc');?>
--INI--
open_basedir=.
session.save_handler=files
session.save_path=
session.name=PHPSESSID
--FILE--
<?php

ob_start();

echo "*** Testing session_save_path() : variation ***\n";
$initdir = __DIR__;
$sessions = ($initdir."/session_save_path_variation4");

chdir($initdir);

// Delete the existing directory
if (file_exists($sessions) === TRUE) {
    @rmdir($sessions);
}

var_dump(mkdir($sessions));
var_dump(chdir($sessions));
ini_set("session.save_path", $initdir);
var_dump(session_save_path());
var_dump(session_start());
var_dump(session_save_path());
var_dump(session_destroy());
var_dump(session_save_path());

echo "Done";
ob_end_flush();
?>
--CLEAN--
<?php
$initdir = __DIR__;
$sessions = ($initdir."/session_save_path_variation4");
var_dump(rmdir($sessions));
?>
--EXPECTF--
*** Testing session_save_path() : variation ***
bool(true)
bool(true)

Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
string(0) ""

Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d

Warning: session_start(): Failed to initialize storage module: files (path: ) in %s on line %d
bool(false)
string(0) ""

Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
bool(false)
string(0) ""
Done

Function Calls

None

Variables

None

Stats

MD5 093bbe409a8179cf85156d3b989cce6d
Eval Count 0
Decode Time 97 ms