PDA

View Full Version : bug in quercus 4.0.1 with isset($_SESSION[])


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.

nam
11-06-2009, 02:03 AM
I'm unable to reproduce this on our trunk version. We had cleaned up isset() for 4.0.2. I think the issue was that the SessionArrayValue.java did not override the isset() function.

ashamash
11-06-2009, 11:44 AM
I'm unable to reproduce this on our trunk version. We had cleaned up isset() for 4.0.2. I think the issue was that the SessionArrayValue.java did not override the isset() function.
That's great news. Any ETA for 4.0.2?

nam
11-06-2009, 10:03 PM
The ETA is mid November.