Removed notice level errors for better cli-script operation

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48146 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-01-17 01:58:37 +00:00
parent 5896e37f0d
commit 1d304a995c
3 changed files with 16 additions and 9 deletions

View File

@ -11,8 +11,8 @@
* @subpackage core
*/
if(isset($_SERVER['argv'][2])) $_SERVER['HTTP_HOST'] = $_SERVER['argv'][2];
$_SERVER['HTTP_HOST'] = $_SERVER['argv'][2];
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
chdir(dirname($_SERVER['SCRIPT_FILENAME']));
@ -53,7 +53,7 @@ if($_REQUEST && get_magic_quotes_gpc()) {
stripslashes_recursively($_REQUEST);
}
if($_REQUEST['trace']) apd_set_pprof_trace();
if(isset($_REQUEST['trace'])) apd_set_pprof_trace();
require_once("core/ManifestBuilder.php");
require_once("core/ClassInfo.php");
@ -96,7 +96,7 @@ if(ManifestBuilder::staleManifest()){
require_once(MANIFEST_FILE);
if($_GET['debugmanifest']) Debug::show(file_get_contents(MANIFEST_FILE));
if(isset($_GET['debugmanifest'])) Debug::show(file_get_contents(MANIFEST_FILE));
if(!isset(Director::$environment_type)) Director::set_environment_type($envType);

View File

@ -5,10 +5,17 @@
* @subpackage email
*/
/**
* X-Mailer header value on emails sent
*/
define('X_MAILER', 'SilverStripe Mailer - version 2006.06.21 (Sent from "'.$_SERVER['SERVER_NAME'].'")');
if(isset($_SERVER['SERVER_NAME'])) {
/**
* X-Mailer header value on emails sent
*/
define('X_MAILER', 'SilverStripe Mailer - version 2006.06.21 (Sent from "'.$_SERVER['SERVER_NAME'].'")');
} else {
/**
* @ignore
*/
define('X_MAILER', 'SilverStripe Mailer - version 2006.06.21');
}
// Note: The constant 'BOUNCE_EMAIL' should be defined as a valid email address for where bounces should be returned to.
/**

View File

@ -46,13 +46,13 @@ class ContentNegotiator {
} else {
// The W3C validator doesn't send an HTTP_ACCEPT header, but it can support xhtml. We put this special case in here so that
// designers don't get worried that their templates are HTML4.
if(substr($_SERVER['HTTP_USER_AGENT'], 0, 14) == 'W3C_Validator/') {
if(isset($_SERVER['HTTP_USER_AGENT']) && substr($_SERVER['HTTP_USER_AGENT'], 0, 14) == 'W3C_Validator/') {
$chosenFormat = "xhtml";
} else {
foreach($mimes as $format => $mime) {
$regExp = '/' . str_replace(array('+','/'),array('\+','\/'), $mime) . '(;q=(\d+\.\d+))?/i';
if (preg_match($regExp, $_SERVER['HTTP_ACCEPT'], $matches)) {
if (isset($_SERVER['HTTP_ACCEPT']) && preg_match($regExp, $_SERVER['HTTP_ACCEPT'], $matches)) {
$preference = isset($matches[2]) ? $matches[2] : 1;
if(!isset($q[$preference])) $q[$preference] = $format;
}