escalator - 2015-03-11

Small update: my tests show that numbers are highlighted in URLs which breaks them up

geshi.php Line 3465

// Highlight numbers. As of 1.0.8 we support different types of numbers
$numbers_found = false;

if ($this->lexic_permissions['NUMBERS'] && preg_match($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'], $stuff_to_parse )) {
    $numbers_found = true;

    //For each of the formats ...
    foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) {
        //Check if it should be highlighted ...
        $stuff_to_parse = preg_replace($regexp, "<|/NUM!$id/>\\1|>", $stuff_to_parse);
    }
}

Example of problematic URL

before

<|UR1|"http://172<DOT>18<DOT>200<DOT>40/umacs"><|/1/>umacs|></a>

after

<|UR1|"http://<|/NUM!0/>172|><DOT><|/NUM!0/>18|><DOT><|/NUM!0/>200|><DOT>40/umacs"><|/1/>umacs|>

Later in line 3481 <|/NUM!0/> is replaced by style classes, which breaks up the URL and results:

<|UR1|"http://<| class="nu0">172|><DOT><| class="nu0">18|><DOT><| class="nu0">200|><DOT>40/umacs"><| class="kw1">umacs|></a>

Example of working URL

before

<|UR1|"http://www<DOT>php<DOT>net/chd"><|/2/>chd|></a>

after

<|UR1|"http://www<DOT>php<DOT>net/chd"><| class="kw2">chd|></a>

Conclusion

  • the above mentioned function block must NOT highlight numbers in URLs

My current workaround

geshi.php Line 3279

$before = '<|UR1|"' .
    str_replace(
        array(
            '{FNAME}',
            '{FNAMEL}',
            '{FNAMEU}',
            '.'),

Remove the dot-sign

$before = '<|UR1|"' .
    str_replace(
        array(
            '{FNAME}',
            '{FNAMEL}',
            '{FNAMEU}',
            ''),