atom-community / atom-community/atom-script

Support PHP script parameter values containing spaces

Open
#600 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
730
Forks
264
PR merge metrics
No merged PRs in 30d

Description

# Summary

When attempting to supply a parameter value containing a space to a PHP script it is necessary to enclose the parameter value in double-quotes. Doing this in the "Program Arguments" field of Script's "Configure Run Options" dialogue results in the parameter being incorrectly parsed.
# To reproduce
## Create and verify test case

Create space_test.php containing the following:

``` php
1 argument(s) received
## Run with Script package in Atom

Open space_test.php in Atom.

Open Script's "Configure Run Options" dialogue and enter `php` in the "Command" field and `"foo bar"` in "Program Arguments".

Click the "Run" button.

The expected result is as before:

> 1 argument(s) received

The actual result is:

> PHP Fatal error: Space mishandled in space_test.php on line 6
> PHP Stack trace:
> PHP 1. {main}() space_test.php:0
> PHP 2. trigger_error() space_test.php:6
> 2 argument(s) received

The above was discovered in Atom 1.0.19 and Script 2.29.0 running on Ubuntu 14.04 LTS 64Bit. `go version` returns:

> go version go1.4.2 linux/amd64

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.