Mantis - Quercus
Viewing Issue Advanced Details
1875 minor always 07-13-07 05:27 07-19-07 16:29
closed 3.1.2  
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. [^]

I'm trying to run geshi 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, but I think others should also be fixed, like, ...
So the exact fix: replace the beginning of the method eq in 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 the following line:
PREG_QUOTE['.'] = true;
And perhaps more characters?


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

    if (rValue.isUnicode()) {
        return equals(rValue);
07-19-07 16:29