mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed infinite loop in FILE_TO_URL_MAPPING lookup when calling arbitrary scripts via CLI (from r98434)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102658 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6e284c2914
commit
ecc73e0cfc
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
if(defined('E_DEPRECATED')) error_reporting(E_ALL ^ E_DEPRECATED);
|
if(defined('E_DEPRECATED')) error_reporting(E_ALL ^ E_DEPRECATED);
|
||||||
else error_reporting(E_ALL);
|
else error_reporting(E_ALL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is for versions of PHP prior to version 5.2
|
* This is for versions of PHP prior to version 5.2
|
||||||
* Creating this here will allow both web requests and cron jobs to inherit it.
|
* Creating this here will allow both web requests and cron jobs to inherit it.
|
||||||
@ -60,7 +59,7 @@ foreach($envFiles as $envFile) {
|
|||||||
if(!isset($_SERVER['HTTP_HOST'])) {
|
if(!isset($_SERVER['HTTP_HOST'])) {
|
||||||
// HTTP_HOST, REQUEST_PORT, SCRIPT_NAME, and PHP_SELF
|
// HTTP_HOST, REQUEST_PORT, SCRIPT_NAME, and PHP_SELF
|
||||||
if(isset($_FILE_TO_URL_MAPPING)) {
|
if(isset($_FILE_TO_URL_MAPPING)) {
|
||||||
$fullPath = $testPath = $_SERVER['SCRIPT_FILENAME'];
|
$fullPath = $testPath = realpath($_SERVER['SCRIPT_FILENAME']);
|
||||||
while($testPath && $testPath != "/" && !preg_match('/^[A-Z]:\\\\$/', $testPath)) {
|
while($testPath && $testPath != "/" && !preg_match('/^[A-Z]:\\\\$/', $testPath)) {
|
||||||
if(isset($_FILE_TO_URL_MAPPING[$testPath])) {
|
if(isset($_FILE_TO_URL_MAPPING[$testPath])) {
|
||||||
$url = $_FILE_TO_URL_MAPPING[$testPath]
|
$url = $_FILE_TO_URL_MAPPING[$testPath]
|
||||||
|
Loading…
Reference in New Issue
Block a user