pk-fr / yakpro-po

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

Aliases not respected #58

Closed serl closed 4 years ago

serl commented 4 years ago

Hello, first of all, thanks for your efforts and this amazing product.

I've an issue with the use of use and aliasing. Namely, this code:

namespace MyWonderfulNamespace;

use \Exception as Saloperie;

try {
  throw new Saloperie('message');
} catch (Saloperie $s) { }

Gets scrambled to:

namespace j_16d;
use Exception as Saloperie;

try {
    throw new KJuQk("\155\x65\163\x73\x61\147\145");
} catch (kJUqk $M42ir) { }

which gives Fatal error: Uncaught Error: Class 'j_16d\KJuQk' not found.

So, the alias itself is not scrambled, and then the two references to my alias don't match because of case differences.

Looks to be the root cause of #54.

serl commented 4 years ago

Trying with version 1.8.11, the result is:

namespace Uv5x9;
use Exception as VZ3Og;

try {
    throw new vz3OG("\x6d\x65\x73\163\x61\147\145");
} catch (vZ3og $tbDU7) { }

...which works! And it also tells me that class names are case-insensitive, so I take that back.

pk-fr commented 4 years ago

fixed with release 2.0.7

Komche commented 1 year ago

I use the version 2.0.14 and I have the same issues

pk-fr commented 1 year ago

it works for me... can you provide me a small example of code that do not work for you?