On Wed, Mar 17, 2010 at 10:57 AM, Andrew Ballard <[email protected]> wrote:
> On Wed, Mar 17, 2010 at 6:38 AM, Matthew Weier O'Phinney
> <[email protected]> wrote:
>> Could you or Christian provide a small script that demonstrates the
>> issue on Windows for me to test, please? The current tests for
>> components such as Zend_View are passing, so we clearly need something
>> new; otherwise, I'll be simply blind-testing, and that doesn't
>> accomplish much.
>>
>> Thanks!
>
> I'm not sure how to boil it down to a simple test case, but I see this
> when running the quickstart. (The version I ran is 20090430 if that
> makes a difference.)
>

[snip]

Actually, it turned out to be pretty simple to build a test case:

testcase.php
<?php


define('LIBRARY_PATH', realpath('D:\\Web
Server\\wwwroot\\lib\\ZendFramework\\library\\1.10.1-no-require'));

// Set the initial include_path. You may need to change this to ensure that
// Zend Framework is in the include_path; additionally, for performance
// reasons, it's best to move this to your web server configuration or php.ini
// for production.
set_include_path(implode(PATH_SEPARATOR, array(
    LIBRARY_PATH,
)));

error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

/** Zend_Loader */
require_once 'Zend/Loader.php';

// A Windows absolute file path for a file that does not exist
$file = 'D:\Web
Server\wwwroot\lib\MyApp\application/controllers/helpers/Redirector.php';


$loader = new Zend_Loader();
$result = $loader->isReadable($file);

echo '$loader->isReadable(' . "'" . str_replace('\\', '\\\\', $file) .
"') === ";
var_dump($result);

?>

Expected result:
$loader->isReadable('D:\\Web
Server\\wwwroot\\lib\\MyApp\\application/controllers/helpers/Redirector.php')
=== bool(false)

Actual result:
Warning: is_readable() [function.is-readable]: open_basedir
restriction in effect. File(D:\Web
Server\wwwroot\lib\ZendFramework\library\1.10.1-no-require/D:\Web
Server\wwwroot\lib\MyApp\application/controllers/helpers/Redirector.php)
is not within the allowed path(s): (D:\Web Server\) in D:\Web
Server\wwwroot\lib\ZendFramework\library\1.10.1-no-require\Zend\Loader.php
 on line 190
$loader->isReadable('D:\\Web
Server\\wwwroot\\lib\\MyApp\\application/controllers/helpers/Redirector.php')
=== bool(false)



Is that what you need?

Andrew

Reply via email to