cjohansson / emacs-phps-mode

Emacs major mode for PHP with code intelligence
GNU General Public License v3.0
36 stars 2 forks source link

Failing lexer for super-escaped expressions #43

Closed cjohansson closed 1 year ago

cjohansson commented 1 year ago

Stubled upon this code in a virus at the lexer can't properly handle it

<?php

function _unQuote($string)
{
    $translate = array(
        "\\000" => "\000",
        "\\n"   => "\n",
        "\\r"   => "\r",
        "\\\\"  => "\\",
        "\'"    => "'",
        "\\\""  => "\"",
        "\\032" => "\032"
    );
    return strtr($string, $translate);
}
cjohansson commented 1 year ago

Fixed in commit 903075dc99d37a99ff72b68ddcfdaf38b48c077b