Mantis - Quercus
Viewing Issue Advanced Details
1107 minor always 05-12-06 21:56 05-15-06 16:06
koreth  
ferg  
normal  
closed 3.0.19  
fixed  
none    
none 3.0.20  
0001107: <?php at head of script works, <?PHP doesn't
The code that checks for the PHP header at the start of a script is case-sensitive. Zend PHP accepts either <?php or <?PHP, but only the former works in Quercus.

Notes
(0001128)
koreth   
05-15-06 14:42   
Patch:

--- orig/resin-3.0.s060510/modules/quercus/src/com/caucho/quercus/parser/Quercus
Parser.java 2006-05-10 06:36:54.000000000 -0700
+++ resin-3.0.s060510/modules/quercus/src/com/caucho/quercus/parser/QuercusParse
r.java 2006-05-15 14:36:10.000000000 -0700
@@ -3530,6 +3530,7 @@
     StringBuilder sb = new StringBuilder();
 
     int ch = read();
+ int ch2, ch3;
     while (ch > 0) {
       if (ch == '<') {
        if ((ch = read()) == 's' || ch == 'S') {
@@ -3564,17 +3565,17 @@
 
          return TEXT;
        }
- else if (ch != 'p') {
+ else if (ch != 'p' && ch != 'P') {
          sb.append("<?");
        }
- else if ((ch = read()) != 'h') {
+ else if ((ch2 = read()) != 'h' && ch2 != 'H') {
          sb.append("<?p");
        }
- else if ((ch = read()) != 'p') {
+ else if ((ch3 = read()) != 'p' && ch3 != 'P') {
          sb.append("<?ph");
        }
        else if (! Character.isWhitespace((ch = read()))) {
- sb.append("<?php");
+ sb.append("<?").append((char)ch).append((char)ch2).append((char)ch3);
        }
        else {
          _lexeme = sb.toString();
(0001133)
ferg   
05-15-06 16:06   
php/0007