| Conditions | 5 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function allow($actions = null) |
||
| 25 | { |
||
| 26 | if ($actions === null) { |
||
| 27 | $controller = $this->_registry->getController(); |
||
| 28 | $this->allowedActions = get_class_methods($controller); |
||
| 29 | |||
| 30 | return; |
||
| 31 | } |
||
| 32 | |||
| 33 | $controller = Inflector::camelize($this->request['controller']); |
||
| 34 | $action = Inflector::underscore($this->request['action']); |
||
| 35 | if (!$this->session->read('Auth.User') || |
||
| 36 | (isset($this->config('allowedActionsForBanned')[$controller]) && |
||
| 37 | in_array($action, array_map('strtolower', $this->config('allowedActionsForBanned')[$controller]))) |
||
| 38 | ) { |
||
| 39 | $this->allowedActions = array_merge($this->allowedActions, (array)$actions); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: