diff --git a/include/classes/config.php b/include/classes/config.php index 76ff6e2..0e57898 100644 --- a/include/classes/config.php +++ b/include/classes/config.php @@ -3,7 +3,7 @@ // Author: Pascal KISSIAN // Resume: http://pascal.kissian.net // -// Copyright (c) 2015-2018 Pascal KISSIAN +// Copyright (c) 2015-2020 Pascal KISSIAN // // Published under the MIT License // Consider it as a proof of concept! @@ -105,7 +105,7 @@ class Config function __construct() { $this->comment .= "/* __________________________________________________".PHP_EOL; - $this->comment .= " | Obfuscated by YAK Pro - Php Obfuscator %-5.5s |".PHP_EOL; + $this->comment .= " | Obfuscated by YAK Pro - Php Obfuscator %-6.6s |".PHP_EOL; $this->comment .= " | on %s |".PHP_EOL; $this->comment .= " | GitHub: https://github.com/pk-fr/yakpro-po |".PHP_EOL; $this->comment .= " |__________________________________________________|".PHP_EOL; diff --git a/include/classes/parser_extensions/my_node_visitor.php b/include/classes/parser_extensions/my_node_visitor.php index 06559ec..23a0d06 100644 --- a/include/classes/parser_extensions/my_node_visitor.php +++ b/include/classes/parser_extensions/my_node_visitor.php @@ -438,14 +438,14 @@ public function leaveNode(PhpParser\Node $node) { if (isset($node->name->parts)) // not set when indirect call (i.e.function name is a variable value!) { - $parts = $node->name->parts; - $name = $parts[count($parts)-1]; - if ( is_string($name) && ($name=='define') ) + $parts = $node->name->parts; + $fn_name = $parts[count($parts)-1]; + if ( is_string($fn_name) && ( ($fn_name=='define') || ($fn_name=='defined') ) ) { for($ok=false;;) { if (!isset($node->args[0]->value)) break; - if (count($node->args)!=2) break; + if ( ($fn_name=='define') && (count($node->args)!=2) ) break; $arg = $node->args[0]->value; if (! ($arg instanceof PhpParser\Node\Scalar\String_) ) break; $name = $arg->value; if (! is_string($name) || (strlen($name) == 0) ) break; $ok = true; @@ -459,7 +459,8 @@ public function leaveNode(PhpParser\Node $node) } if (!$ok) { - throw new Exception("Error: your use of define() function is not compatible with yakpro-po!".PHP_EOL."\tOnly 2 parameters, when first is a literal string is allowed..."); + if ($fn_name=='define') throw new Exception("Error: your use of $fn_name() function is not compatible with yakpro-po!".PHP_EOL."\tOnly 2 parameters, when first is a literal string is allowed..."); + else throw new Exception("Error: your use of $fn_name() function is not compatible with yakpro-po!".PHP_EOL."\tOnly 1 literal string parameter is allowed..."); } } } diff --git a/version.php b/version.php index cd8a9ff..4a149c9 100644 --- a/version.php +++ b/version.php @@ -11,6 +11,6 @@ // Use and abuse at your own risks. //======================================================================== -$yakpro_po_version = "2.0.10"; +$yakpro_po_version = "2.0.11"; ?> \ No newline at end of file