Mantis - Quercus
Viewing Issue Advanced Details
1875 minor always 07-13-07 05:27 07-19-07 16:29
feherg  
nam  
normal  
closed 3.1.2  
fixed  
none    
none 3.1.3  
0001875: making geshi run: preg_quote and string comparison problems (svn snapshot 2834)
Geshi is a program source code syntax higlighter written in php, it inputs the source code and outputs it colored in html.
It supports a lot of programming languages and several cms systmes are using it.
http://qbnz.com/highlighter/ [^]

I'm trying to run geshi 1.0.7.20 under the latest quercus snapshot, but in many cases it produces incorrect html code. (The same was for quercus 3.1.1) I found and fixed two bugs in quercus which seems to solve these problems.
But they might mess other things :)


bug 0000001: string comparision
This problem (bug 1850) is still exists in the svn head. The exact problem is that
the expression "0" == "" evaluates to true, but "" == "0" evaluates to false. Both should evaluate to false.
my fix 0000001:
I think that quercus souldn't do conversions when comparing two variables of the same type.
I only fixed this in UnicodeValue.java, but I think others should also be fixed, like StringValue.java, ...
So the exact fix: replace the beginning of the method eq in UnicodeValue.java with this:
public boolean eq(Value rValue)
  {
    rValue = rValue.toValue();

    if (rValue.isUnicode()) {
        return equals(isUnicode());
    }



bug 0000002: preg_quote
The function preg_quote should quote the . (dot) character but it doesn't do it.
my fix 0000002:
Insert at the and of RegexpModule.java the following line:
PREG_QUOTE['.'] = true;
And perhaps more characters?

Bye
Gabor

Notes
(0002113)
feherg   
07-13-07 05:33   
The comparison fix, correctly:
  public boolean eq(Value rValue)
  {
    
    rValue = rValue.toValue();

    if (rValue.isUnicode()) {
        return equals(rValue);
    }
(0002119)
nam   
07-19-07 16:29   
php/036[n-z]
php/150k