BUGFIX Merged in PHP 5.3 bugfixes from trunk

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@81883 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-07-15 05:20:37 +00:00 committed by Sam Minnee
parent cae70c9c91
commit b2374aabe6
2 changed files with 10 additions and 6 deletions

View File

@ -21,7 +21,8 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// ENVIRONMENT CONFIG // ENVIRONMENT CONFIG
error_reporting(E_ALL); if(defined('E_DEPRECATED')) error_reporting(E_ALL ^ E_DEPRECATED);
else error_reporting(E_ALL);
/** /**
* Include _ss_environment.php files * Include _ss_environment.php files
@ -46,9 +47,11 @@ 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 = $_SERVER['SCRIPT_FILENAME'];
while($testPath && $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] . substr($fullPath,strlen($testPath)); $url = $_FILE_TO_URL_MAPPING[$testPath]
. str_replace(DIRECTORY_SEPARATOR,'/',substr($fullPath,strlen($testPath)));
$_SERVER['HTTP_HOST'] = parse_url($url, PHP_URL_HOST); $_SERVER['HTTP_HOST'] = parse_url($url, PHP_URL_HOST);
$_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = parse_url($url, PHP_URL_PATH); $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = parse_url($url, PHP_URL_PATH);
$_SERVER['REQUEST_PORT'] = parse_url($url, PHP_URL_PORT); $_SERVER['REQUEST_PORT'] = parse_url($url, PHP_URL_PORT);
@ -155,7 +158,8 @@ if(isset($_GET['debugmanifest'])) Debug::show(file_get_contents(MANIFEST_FILE));
// This is necessary to force developers to acknowledge and fix // This is necessary to force developers to acknowledge and fix
// notice level errors (you can override this directive in your _config.php) // notice level errors (you can override this directive in your _config.php)
if (Director::isLive()) { if (Director::isLive()) {
error_reporting(E_ALL ^ E_NOTICE); if(defined('E_DEPRECATED')) error_reporting((E_ALL ^ E_NOTICE) ^ E_DEPRECATED);
else error_reporting(E_ALL ^ E_NOTICE);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// POST-MANIFEST COMMANDS // POST-MANIFEST COMMANDS

View File

@ -39,7 +39,7 @@ class DevelopmentAdmin extends Controller {
if(Director::is_cli()) { if(Director::is_cli()) {
if(isset($_FILE_TO_URL_MAPPING)) { if(isset($_FILE_TO_URL_MAPPING)) {
$fullPath = $testPath = $_SERVER['SCRIPT_FILENAME']; $fullPath = $testPath = $_SERVER['SCRIPT_FILENAME'];
while($testPath && $testPath != "/") { while($testPath && $testPath != "/" && !preg_match('/^[A-Z]:\\\\$/', $testPath)) {
$matched = false; $matched = false;
if(isset($_FILE_TO_URL_MAPPING[$testPath])) { if(isset($_FILE_TO_URL_MAPPING[$testPath])) {
$matched = true; $matched = true;