ashamash
11-05-2009, 10:37 PM
Hi All -
I think I found a bug around how Quercus handles isset() relative to how mod_php handles it in apache. Consider this test case:
html file #1:
<?php
@define('TEST_STRING_1', 'TEST_STRING_1');
session_start();
?>
<HTML>
<HEAD>
<TITLE>PHP Session Test</TITLE>
</HEAD>
<BODY>
<pre>
<?php
$_SESSION[TEST_STRING_1]="foo";
if (isset($_SESSION[TEST_STRING_1])) {
print("location 1: TEST_STRING_1 isset");
}
?>
</pre>
</BODY>
</HTML>
html file #2:
<?php
@define('TEST_STRING_1', 'TEST_STRING_1');
session_start();
?>
<HTML>
<HEAD>
<TITLE>PHP Session Test</TITLE>
</HEAD>
<BODY>
<pre>
<?php
if (isset($_SESSION[TEST_STRING_1])) {
print("location 1: TEST_STRING_1 isset\n");
}
$var1 = $_SESSION[TEST_STRING_1];
if (isset($var1)) {
print("location 2: var1 isset\n");
}
?>
</pre>
</BODY>
</HTML>
After loading html file #1 in the browser, load html file #2. Under quercus, the only output you get is:
location 2: var1 isset
whereas under apache, you get:
location 1: TEST_STRING_1 isset
location 2: var1 isset
I believe Apache's behavior is correct, at least the code I'm trying to run under Quercus is expecting the same behavior as exhibited by Apache.
I briefly scanned the Quercus source code to see if I can figure out what's going on, but haven't figured it out yet. Will continue trying.
I think I found a bug around how Quercus handles isset() relative to how mod_php handles it in apache. Consider this test case:
html file #1:
<?php
@define('TEST_STRING_1', 'TEST_STRING_1');
session_start();
?>
<HTML>
<HEAD>
<TITLE>PHP Session Test</TITLE>
</HEAD>
<BODY>
<pre>
<?php
$_SESSION[TEST_STRING_1]="foo";
if (isset($_SESSION[TEST_STRING_1])) {
print("location 1: TEST_STRING_1 isset");
}
?>
</pre>
</BODY>
</HTML>
html file #2:
<?php
@define('TEST_STRING_1', 'TEST_STRING_1');
session_start();
?>
<HTML>
<HEAD>
<TITLE>PHP Session Test</TITLE>
</HEAD>
<BODY>
<pre>
<?php
if (isset($_SESSION[TEST_STRING_1])) {
print("location 1: TEST_STRING_1 isset\n");
}
$var1 = $_SESSION[TEST_STRING_1];
if (isset($var1)) {
print("location 2: var1 isset\n");
}
?>
</pre>
</BODY>
</HTML>
After loading html file #1 in the browser, load html file #2. Under quercus, the only output you get is:
location 2: var1 isset
whereas under apache, you get:
location 1: TEST_STRING_1 isset
location 2: var1 isset
I believe Apache's behavior is correct, at least the code I'm trying to run under Quercus is expecting the same behavior as exhibited by Apache.
I briefly scanned the Quercus source code to see if I can figure out what's going on, but haven't figured it out yet. Will continue trying.