1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 16:42:57 +00:00

Set $_SERVER['SCRIPT_NAME'] within proxy command (#11562)

This commit is contained in:
Dan Wallis 2023-08-02 10:55:24 +01:00 committed by GitHub
parent f4738d97b7
commit 9c25633d6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -110,6 +110,18 @@ EOL
<?php declare(strict_types=1);
echo 'success '.$_SERVER['argv'][1];
EOL
],
'php file which validates $_SERVER["SCRIPT_NAME"]' => [<<<'EOL'
<?php
if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) {
echo 'success '.$_SERVER['argv'][1];
} else {
fwrite(STDERR, "Test failure: __FILE__ does not match \$_SERVER['SCRIPT_NAME']\n");
fwrite(STDERR, "\t__FILE__:\t" . __FILE__ . "\n");
fwrite(STDERR, "\t\$_SERVER['SCRIPT_NAME']:\t" . $_SERVER['SCRIPT_NAME'] . "\n");
exit(1);
}
EOL
],
];