Skip to content

Commit 581a274

Browse files
Use escapeshellarg()
1 parent 9737f79 commit 581a274

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "crusse/job-server",
33
"description": "A library for computing the results of multiple PHP scripts in parallel",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"require": {
66
"php": ">=5.3.3",
77
"symfony/process": "^2.6"

src/Crusse/JobServer/Server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ private function createWorkerProcs( $count ) {
105105
for ( $i = 0; $i < $count; $i++ ) {
106106
// We use 'nice' to make the worker process slightly lower priority than
107107
// regular PHP processes that are run by the web server, so that the
108-
// worker's don't bring down the web server so easily
108+
// workers don't bring down the web server so easily
109109
$process = new Process( 'exec nice -n 5 php '. dirname( __FILE__ ) .
110-
'/worker_process.php \''. $this->serverSocketAddr .'\'' );
110+
'/worker_process.php '. escapeshellarg( $this->serverSocketAddr ) );
111111

112112
// We don't need stdout/stderr as we're communicating via sockets
113113
$process->disableOutput();

tests/test.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,6 @@ function generateString($length) {
6767

6868
echo 'Finished in '. $elapsed .' ms'. PHP_EOL;
6969
echo 'Total '. $elapsedTotal .' ms'. PHP_EOL;
70-
70+
echo PHP_EOL;
71+
echo 'Successfully ran all tests'. PHP_EOL;
72+
echo PHP_EOL;

0 commit comments

Comments
 (0)