Skip to content

Process.php exception when $_ENV contains array value #7196

Closed
@mmucklo

Description

@mmucklo

Line 138-142 of Process.php:

        if (null !== $env) {
            $this->env = array();
            foreach ($env as $key => $value) {
                $this->env[(binary) $key] = (binary) $value;
            }

In certain circumstances, ProcessBuilder.php will grab $_ENV and merge it into the array passed into Process.php

ProcessBuilder.php line 148-154:

        if ($this->inheritEnv) {
            $env = $this->env ? $this->env + $_ENV : null;
        } else {
            $env = $this->env;
        }

        return new Process($script, $this->cwd, $env, $this->stdin, $this->timeout, $options);

The problem is that there are certain cases where $_ENV['something'] can be an array.

Right now in one of our environments, I'm seeing $_ENV['argv'] as an array, for example. This happens during Less to CSS generation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions