Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
2119 | minor | always | 10-26-07 20:01 | 10-29-07 14:12 | |
|
|||||
Reporter: | koreth | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.1.3 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.1.4 | ||
|
|||||
Summary: | 0002119: Binary values get altered when concatenated to a string | ||||
Description: |
test/TestBinary.java: package test; import com.caucho.quercus.env.*; class TestBinary { public static BinaryValue doTest() { byte[] testArray = new byte[1]; testArray[0] = (byte)0x9c; return new BinaryBuilderValue(testArray); } } test.php: <?php import test.TestBinary; $var = TestBinary::doTest(); $fp = fopen("/tmp/x", "w"); fwrite($fp, $var); fwrite($fp, "x" . $var); fclose($fp); If you examine /tmp/x, you will see that the first fwrite() wrote the binary value, 0x9c. Then there's an "x" (0x78). Then, instead of another 0x9c, you'll see 0xfa. If you change the $var assignment to "$var = chr(156);" then you get the correct output; this only seems to manifest with binary values returned by Java code (it bit me in some custom serialization code.) Now that I've identified the problem I can work around it but it certainly seems like a bug. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|