Skip to content
Permalink
Browse files

Stricter string comparisons.

  • Loading branch information...
dereuromark committed Apr 29, 2014
1 parent 1d1a2f8 commit bd074e7dc7cb0efb9f96220a6bb5540ca30a247e
@@ -722,7 +722,7 @@ public function redirectUrl($url = null) {
$redir = $this->Session->read('Auth.redirect');
$this->Session->delete('Auth.redirect');
if (Router::normalize($redir) == Router::normalize($this->loginAction)) {
if (Router::normalize($redir) === Router::normalize($this->loginAction)) {
$redir = $this->loginRedirect;
}
} elseif ($this->loginRedirect) {
@@ -392,7 +392,7 @@ public function validateSort(Model $object, array $options, array $whitelist = a
if (strpos($key, '.') !== false) {
list($alias, $field) = explode('.', $key);
}
$correctAlias = ($object->alias == $alias);
$correctAlias = ($object->alias === $alias);
if ($correctAlias && $object->hasField($field)) {
$order[$object->alias . '.' . $field] = $value;
@@ -525,7 +525,7 @@ public function requestedWith($type = null) {
return $this->mapType($contentType);
}
if (is_string($type)) {
return ($type == $this->mapType($contentType));
return ($type === $this->mapType($contentType));
}
}
@@ -230,7 +230,7 @@ public function startup(Controller $controller) {
$controller->request->params['requested'] != 1
);
if ($this->_action == $this->blackHoleCallback) {
if ($this->_action === $this->blackHoleCallback) {
return $this->blackHole($controller, 'auth');
}
@@ -362,7 +362,7 @@ protected function _methodsRequired(Controller $controller) {
$property = 'require' . $method;
if (is_array($this->$property) && !empty($this->$property)) {
$require = $this->$property;
if (in_array($this->_action, $require) || $this->$property == array('*')) {
if (in_array($this->_action, $require) || $this->$property === array('*')) {
if (!$this->request->is($method)) {
if (!$this->blackHole($controller, $method)) {
return null;
@@ -384,7 +384,7 @@ protected function _secureRequired(Controller $controller) {
if (is_array($this->requireSecure) && !empty($this->requireSecure)) {
$requireSecure = $this->requireSecure;
if (in_array($this->_action, $requireSecure) || $this->requireSecure == array('*')) {
if (in_array($this->_action, $requireSecure) || $this->requireSecure === array('*')) {
if (!$this->request->is('ssl')) {
if (!$this->blackHole($controller, 'secure')) {
return null;
@@ -405,7 +405,7 @@ protected function _authRequired(Controller $controller) {
if (is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($this->request->data)) {
$requireAuth = $this->requireAuth;
if (in_array($this->request->params['action'], $requireAuth) || $this->requireAuth == array('*')) {
if (in_array($this->request->params['action'], $requireAuth) || $this->requireAuth === array('*')) {
if (!isset($controller->request->data['_Token'])) {
if (!$this->blackHole($controller, 'auth')) {
return null;

0 comments on commit bd074e7

Please sign in to comment.
You can’t perform that action at this time.