Compare commits

...

10 Commits

Author SHA1 Message Date
Simon Sessingø 8111de48fd Merge pull request #378 from skipperbent/v3-development
Fixed issue with PDO exception not returning correct type for error-code.
2018-02-27 08:36:43 +01:00
Simon Sessingo 79c82c90cc Fixed issue with PDO exception not returning correct type for error-code. 2018-02-27 08:20:25 +01:00
Simon Sessingø 0dbc4e6ba2 Merge pull request #376 from skipperbent/v3-development
Optimisations
2018-02-27 00:20:12 +01:00
Simon Sessingo 6d7d07669b Optimisations 2018-02-27 00:19:44 +01:00
Simon Sessingø a4dfa59a66 Merge pull request #374 from skipperbent/v3-development
Stop router from processing routes if no valid route is found.
2018-02-27 00:14:24 +01:00
Simon Sessingo 98bf95bfc9 Added back getPath. 2018-02-27 00:14:01 +01:00
Simon Sessingo b051bcf02b Stop router from processing routes if no valid route is found. 2018-02-27 00:12:45 +01:00
Simon Sessingo b8d5106f4e Removed getPath from url. 2018-02-27 00:00:54 +01:00
Simon Sessingø 2c9d996437 Merge pull request #372 from skipperbent/v3-development
Fixed setUrl issue.
2018-02-26 23:48:45 +01:00
Simon Sessingo cfc9ac138a Fixed setUrl issue. 2018-02-26 23:48:09 +01:00
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -217,7 +217,7 @@ class Request
*/
public function setUrl($url)
{
$this->url = is_string($url) ? new Url($url) : $url;
$this->url = ($url instanceof Url) ? $url : new Url($url);
}
/**
@@ -36,7 +36,7 @@ class CookieTokenProvider implements ITokenProvider
try {
return bin2hex(random_bytes(32));
} catch(\Exception $e) {
throw new SecurityException($e->getMessage(), $e->getCode(), $e->getPrevious());
throw new SecurityException($e->getMessage(), (int)$e->getCode(), $e->getPrevious());
}
}
+6 -1
View File
@@ -124,6 +124,11 @@ class Router
$exceptionHandlers = [];
// Stop processing routes if no valid route is found.
if($this->request->getRewriteRoute() === null && $this->request->getUrl() === null) {
return;
}
$url = ($this->request->getRewriteUrl() !== null) ? $this->request->getRewriteUrl() : $this->request->getUrl()->getPath();
foreach ($routes as $route) {
@@ -360,7 +365,7 @@ class Router
}
}
throw new HttpException($e->getMessage(), $e->getCode(), $e->getPrevious());
throw new HttpException($e->getMessage(), (int)$e->getCode(), $e->getPrevious());
}
public function arrayToParams(array $getParams = [], $includeEmpty = true)