pk-fr / yakpro-po

YAK Pro - Php Obfuscator
http://www.php-obfuscator.com
Other
1.29k stars 363 forks source link

Class constant reference using self keyword is not processed correctly #5

Closed mologie closed 8 years ago

mologie commented 8 years ago

Hey, I've been testing your obfuscator (and it's awesome so far.) I stumbled over a few minor issues and will open a report to track the status for each.

Test case:

<?php
class Test {
    const FOO = 'BAR';
    static public function printFoo() {
        echo self::FOO;
    }
}

Example obfuscated output:

<?php
class VTMys
{
    const tbLwc = "\x42\101\x52";
    public static function X09pB()
    {
        echo self::FOO;
    }
}

The obfuscated code will not run because self::FOO was not replaced by self::tbLwc.

pk-fr commented 8 years ago

Hi Oliver,

I just published 1.8.0 release a new config file $conf->t_ignore_pre_defined_classes element, replaces the old $conf->t_ignore_module_methods.

all pre-defined classes, class constants, properties, and methods are now not obfuscated by default. as a side effect, we do no more need to ignore obfuscation for class constants (that's worked not very well)

the issue is so corrected.

Cheers, Pascal