pk-fr / yakpro-po

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

error on empty files #9

Closed Antoine321 closed 8 years ago

Antoine321 commented 8 years ago

I have yakpropo sometimes processing php files containing only the php opener and a carriage return "<?php "

(that file has to be there and go through the obfuscator, Framework reasons, a standard file that is usually not empty but sometimes is).

As log says (below), it's probably an issue in PhpParser, but maybe yakpropo could have a workaround? It's not a blocking issue for me, I put a dummy code line in the file. <?php if (FALSE) {}

And it works fine this way. But I thought I could give feedback for improvement :).

Log:

Info: Using [C:\tortoise\Cortex\WebFramework\LTK\tools\yakpro-po\yakpro-po.cnf] Config File... Info: Process Mode = file Info: source_file = [C:\tortoise\Cortex\WebFramework\Template\src\data.php] Info: target_file = [C:/xampp/htdocs/Cux/Template/data.php] Obfuscating C:\tortoise\Cortex\WebFramework\Template\src\data.php

Fatal error: Uncaught Error: Call to a member function getAttribute() on null in C:\tortoise\Cortex\WebFramework\LTK\tools\yakpro-po\PHP-Parser\lib\PhpParser\PrettyPrinterAbstract.php:155 Stack trace:

0 C:\tortoise\Cortex\WebFramework\LTK\tools\yakpro-po\PHP-Parser\lib\PhpParser\PrettyPrinterAbstract.php(94): PhpParser\PrettyPrinterAbstract->pStmts(Array, false)

1 C:\tortoise\Cortex\WebFramework\LTK\tools\yakpro-po\PHP-Parser\lib\PhpParser\PrettyPrinterAbstract.php(116): PhpParser\PrettyPrinterAbstract->prettyPrint(Array)

2 C:\tortoise\Cortex\WebFramework\LTK\tools\yakpro-po\include\functions.php(58): PhpParser\PrettyPrinterAbstract->prettyPrintFile(Array)

3 C:\tortoise\Cortex\WebFramework\LTK\tools\yakpro-po\yakpro-po.php(60): obfuscate('C:\tortoise\Cor...')

4 {main}

thrown in C:\tortoise\Cortex\WebFramework\LTK\tools\yakpro-po\PHP-Parser\lib\PhpParser\PrettyPrinterAbstract.php on line 155 make[2]: *\ [C:/xampp/htdocs/Cux/Template/data.php] Error 255

pk-fr commented 8 years ago

fixed in 1.8.3

thanks for feedback...

Antoine321 commented 8 years ago

Yay :) it works fine