Skip to content
This repository
Browse code

BUGFIX Use of Link() in security classes now refers to $this->controller

instead of calling the instance method Link statically (which isn't
allowed for E_STRICT compliance.)
  • Loading branch information...
commit fd3de5158d4231bce15d69d9d6cfca1b0cc4f3f1 1 parent 6b40377
Sean Harvey authored April 12, 2012
2  security/ChangePasswordForm.php
@@ -111,7 +111,7 @@ function doChangePassword(array $data) {
111 111
 				}
112 112
 				else {
113 113
 					// Redirect to default location - the login form saying "You are logged in as..."
114  
-					$redirectURL = HTTP::setGetVar('BackURL', Director::absoluteBaseURL(), Security::Link('login'));
  114
+					$redirectURL = HTTP::setGetVar('BackURL', Director::absoluteBaseURL(), $this->controller->Link('login'));
115 115
 					Director::redirect($redirectURL);					
116 116
 				}
117 117
 			} else {
6  security/MemberLoginForm.php
@@ -130,14 +130,14 @@ public function dologin($data) {
130 130
 			if(isset($_REQUEST['BackURL'])) $backURL = $_REQUEST['BackURL']; 
131 131
 			else $backURL = null; 
132 132
 
133  
-		 	if($backURL) Session::set('BackURL', $backURL);			
  133
+			if($backURL) Session::set('BackURL', $backURL);
134 134
 			
135 135
 			if($badLoginURL = Session::get("BadLoginURL")) {
136 136
 				$this->controller->redirect($badLoginURL);
137 137
 			} else {
138 138
 				// Show the right tab on failed login
139  
-				$loginLink = Director::absoluteURL(Security::Link("login")); 
140  
-				if($backURL) $loginLink .= '?BackURL=' . urlencode($backURL); 
  139
+				$loginLink = Director::absoluteURL($this->controller->Link('login'));
  140
+				if($backURL) $loginLink .= '?BackURL=' . urlencode($backURL);
141 141
 				$this->controller->redirect($loginLink . '#' . $this->FormName() .'_tab');
142 142
 			}
143 143
 		}
2  security/PermissionCheckboxSetField.php
@@ -281,7 +281,7 @@ class PermissionCheckboxSetField_Readonly extends PermissionCheckboxSetField {
281 281
 
282 282
 	protected $readonly = true;
283 283
 	
284  
-	function saveInto($record) {
  284
+	function saveInto(DataObjectInterface $record) {
285 285
 		return false;
286 286
 	}
287 287
 }
4  security/Security.php
@@ -514,7 +514,9 @@ public function passwordsent($request) {
514 514
 	 */
515 515
 	public static function getPasswordResetLink($autoLoginHash) {
516 516
 		$autoLoginHash = urldecode($autoLoginHash);
517  
-		return self::Link('changepassword') . "?h=$autoLoginHash";
  517
+		$selfControllerClass = __CLASS__;
  518
+		$selfController = new $selfControllerClass();
  519
+		return $selfController->Link('changepassword') . "?h=$autoLoginHash";
518 520
 	}
519 521
 	
520 522
 	/**

0 notes on commit fd3de51

Please sign in to comment.
Something went wrong with that request. Please try again.