mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added a security fix for Security::check_default_admin()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43686 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
74f154fcda
commit
94c923459d
@ -515,11 +515,18 @@ class Security extends Controller {
|
||||
*/
|
||||
public static function check_default_admin($username, $password) {
|
||||
return (
|
||||
self::$default_username == $username
|
||||
&& self::$default_password == $password
|
||||
self::$default_username === $username
|
||||
&& self::$default_password === $password
|
||||
&& self::has_default_admin()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check that the default admin account has been set.
|
||||
*/
|
||||
public static function has_default_admin() {
|
||||
return !empty(self::$default_admin) && !empty(self::$default_password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set strict path checking
|
||||
|
Loading…
Reference in New Issue
Block a user