diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 9bec57d2607..9a44de55e92 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -451,6 +451,17 @@ jobs: OUTPUT=$(../../bin/phpstan analyze -l 0 -vvv test.php 2>&1) echo "$OUTPUT" ../bashunit -a contains 'Parallel processing scheduler' "$OUTPUT" + - script: | + cd e2e/bug-14093 + # Use a relative sys_temp_dir so the value starts with a letter (not /), just like Windows + # paths starting with a drive letter. If the sys_temp_dir value isn't correctly quoted, + # PHP evaluates ~ as a bitwise NOT rather than a literal character, truncating the path. + mkdir tmp~1 + php -d "sys_temp_dir='tmp~1'" ../../bin/phpstan analyze + if [ -d tmp ]; then + echo "FAIL: tmp was created by a worker, meaning sys_temp_dir='tmp~1' was incorrectly evaluated to 'tmp'" + exit 1 + fi steps: - name: Harden the runner (Audit all outbound calls) diff --git a/e2e/bug-14093/phpstan.neon b/e2e/bug-14093/phpstan.neon new file mode 100644 index 00000000000..14f9de4dceb --- /dev/null +++ b/e2e/bug-14093/phpstan.neon @@ -0,0 +1,4 @@ +parameters: + level: 8 + paths: + - test.php diff --git a/e2e/bug-14093/test.php b/e2e/bug-14093/test.php new file mode 100644 index 00000000000..29c13da5315 --- /dev/null +++ b/e2e/bug-14093/test.php @@ -0,0 +1,6 @@ +getOption('memory-limit') === null) {