mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixed some php notices
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39034 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fe2314a08e
commit
97ff1db6f9
@ -179,7 +179,7 @@ class ManifestBuilder {
|
||||
|
||||
} else if(substr($item,-4) == '.css') {
|
||||
$cssName = substr($item, 0, -4);
|
||||
Debug::message($item);
|
||||
// Debug::message($item);
|
||||
|
||||
if($themeName) {
|
||||
$cssManifest[$cssName]['themes'][$themeName] = "$folder/$item";
|
||||
|
@ -71,7 +71,7 @@ class ErrorPage extends Page {
|
||||
// Temporarily log out when producing this page
|
||||
$loggedInMember = Member::currentUser();
|
||||
Session::clear("loggedInAs");
|
||||
$alc_enc = $_COOKIE['alc_enc'];
|
||||
$alc_enc = isset($_COOKIE['alc_enc']) ? $_COOKIE['alc_enc'] : null;
|
||||
Cookie::set('alc_enc', null);
|
||||
|
||||
// Run the page
|
||||
@ -86,7 +86,9 @@ class ErrorPage extends Page {
|
||||
|
||||
// Log back in
|
||||
Session::set("loggedInAs", $loggedInMember->ID);
|
||||
if(isset($alc_enc)) {
|
||||
Cookie::set('alc_enc', $alc_enc);
|
||||
}
|
||||
|
||||
return $this->extension_instances['Versioned']->publish($fromStage, $toStage, $createNewVersion);
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ class Versioned extends DataObjectDecorator {
|
||||
$from = Versioned::get_one_by_stage($this->owner->class, $fromStage, "`{$baseClass}`.ID = {$this->owner->ID}");
|
||||
}
|
||||
|
||||
$publisherID = Member::currentUser()->ID ? Member::currentUser()->ID : 0;
|
||||
$publisherID = isset(Member::currentUser()->ID) ? Member::currentUser()->ID : 0;
|
||||
|
||||
if($from) {
|
||||
$from->forceChange();
|
||||
|
@ -404,7 +404,7 @@ class Member extends DataObject {
|
||||
function requireDefaultRecords() {
|
||||
parent::requireDefaultRecords();
|
||||
|
||||
if(!DB::query("SELECT * FROM Member")->value() && $_REQUEST['username'] && $_REQUEST['password']) {
|
||||
if(!DB::query("SELECT * FROM Member")->value() && isset($_REQUEST['username']) && isset($_REQUEST['password'])) {
|
||||
Security::findAnAdministrator($_REQUEST['username'], $_REQUEST['password']);
|
||||
|
||||
if(!Database::$supressOutput) {
|
||||
|
@ -211,7 +211,7 @@ class Security extends Controller {
|
||||
Permission::grant($adminGroup->ID, "ADMIN");
|
||||
}
|
||||
|
||||
if(!$member) {
|
||||
if(!isset($member)) {
|
||||
$member = Object::create('Member');
|
||||
$member->FirstName = $member->Surname = 'Admin';
|
||||
$member->Email = $username;
|
||||
|
Loading…
Reference in New Issue
Block a user