Skip to content

Commit 2fb2a9d

Browse files
authored
Merge pull request #81 from kkmuffme/patch-1
2 parents 7c2e59e + 25e9cc1 commit 2fb2a9d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/EvalFile_Command.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,15 @@ public function __invoke( $args, $assoc_args ) {
6363
* Evaluate a provided file.
6464
*
6565
* @param string $file Filepath to execute, or - for STDIN.
66-
* @param mixed $args Array of positional arguments to pass to the file.
66+
* @param mixed $positional_args Array of positional arguments to pass to the file.
6767
* @param bool $use_include Process the provided file via include instead of evaluating its contents.
6868
*/
69-
private static function execute_eval( $file, $args, $use_include ) {
69+
private static function execute_eval( $file, $positional_args, $use_include ) {
70+
global $args;
71+
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
72+
$args = $positional_args;
73+
unset( $positional_args );
74+
7075
if ( '-' === $file ) {
7176
eval( '?>' . file_get_contents( 'php://stdin' ) );
7277
} elseif ( $use_include ) {

0 commit comments

Comments
 (0)