Commit Graph

343 Commits

Author SHA1 Message Date
Simon Sessingo aa5ec47051 Removed key check in __get as it's already performed in the __isset method. 2017-12-16 23:24:31 +01:00
Simon Sessingo 155729074b Fixed filtering on get-params in all method. 2017-12-16 12:48:10 +01:00
Simon Sessingø 0be7bfcfd9 Fixed utf-8 header issue (issue: #333) 2017-12-09 23:56:37 +01:00
Simon Sessingø 7f8d90eef8 Added $options and $debt param to json method in Response class. 2017-12-06 19:04:48 +01:00
Simon Sessingo c4ee1b9186 Optimisations 2017-12-02 19:30:30 +01:00
Simon Sessingø efd5159604 Bugfixes
- Fixed issue with parsing parameters on some occasion.
- Optimisations.
2017-11-27 02:03:12 +01:00
Simon Sessingø bdfc36ed5c More Input-related optimisations. 2017-11-27 00:00:19 +01:00
Simon Sessingø d921ae8105 Bugfixes
- Fixed minor issues with File Input-parsing.
- Optimized Input class.
2017-11-26 23:42:28 +01:00
Simon Sessingø af2be14ccb Fixed url parsing issues 2017-11-26 18:45:06 +01:00
Simon Sessingø fae2e84c98 Fixed typo 2017-11-26 18:29:00 +01:00
Simon Sessingø 05f2493304 Development
- Optimized Uri class.
- Request class now uses SimpleRouter to get default-namespace as was
originally the intended behavior.
- Documentation changes.
2017-11-26 18:03:14 +01:00
Simon Sessingø 35dc26d741 Optimisations
- Fixed issue with `InputFile` not setting file-name properly.
- Fixed issue with `InputFile` not setting the correct index when
posting certain arrays.
- Made Csrf-token cookie provider more versitile by creating new
`CookieTokenProvider` and `ITokenProvider` classes.
- Strict-checks optimisations.
- Updated documentation to reflect new changes.
2017-11-26 17:32:33 +01:00
Simon Sessingø b9aa348b38 Merge branch 'v3-development' of github.com:skipperbent/simple-php-router into v3-development 2017-11-25 01:32:24 +01:00
Simon Sessingø c29c52ae16 Fixed default-namespace causing router to break on closures. 2017-11-25 01:31:43 +01:00
Simon Sessingø c3072e8886 Csrf-token are now refreshed on each page-load to avoid timeout. 2017-11-10 12:59:59 +01:00
Simon Sessingø 97753f5370 Minor optimisations. 2017-11-10 08:23:15 +01:00
Simon Sessingø eb63a5d6ba Added CSRF form-example in documentation (issue: #299) 2017-10-23 22:01:19 +02:00
Juan Antonio Tubio c45cd6347a Added more info on route or method not allowed exception 2017-10-11 16:02:26 +02:00
Simon Sessingø 41705f030a Fixed: try next exception-handler if one throws error. 2017-10-07 12:33:24 +01:00
Simon Sessingø a5aac57ce9 Added RoutePartialGroup support. 2017-09-03 18:24:51 +01:00
Simon Sessingø 7f924c7d0a Added RouterGroupTest unit-tests. 2017-09-03 16:49:15 +01:00
Simon Sessingø 3a90578351 Added parameter support for Group routes. 2017-09-03 16:37:20 +01:00
Simon Sessingø ae68598024 Response->json now accepts either array or \JsonSerializable (issue: 2017-08-31 12:03:17 +01:00
Simon Sessingø c82d91375c Urldecode is now used on all urls in Uri class (issue: #268) 2017-08-24 15:50:13 +01:00
Simon Sessingø 957a382248 Ensured that Request class is using unencoded-url header to avoid encoding issues on IIS (issue: #268) 2017-08-24 02:05:18 +01:00
Simon Sessingø 9f509ac818 Added unicode parameter regex support. 2017-08-23 22:49:35 +01:00
Simon Sessingø b3e99a2283 Merge pull request #267 from skipperbent/fix-url
Fixed: return / if all parameters are empty in getUrl method.
2017-08-23 22:17:15 +02:00
Simon Sessingø 65c811356d Fixed url parsing for unicode characters. 2017-08-23 21:04:11 +01:00
Simon Sessingø ea255baec3 Merge branch 'v3-fix-url-encoding' into v3-feature-uri 2017-08-23 20:44:57 +01:00
Simon Sessingø acf37c4023 Updated Uri class. 2017-08-23 20:41:49 +01:00
Simon Sessingø e84c8c2f02 Uri is now always urldecoded in Request class to ensure compability with
most webservers (issue: #268).
2017-08-23 16:13:44 +01:00
Simon Sessingø 7c970c442c Added Uri class which can be used to parse urls. 2017-08-23 16:10:15 +01:00
Simon Sessingø 4cd1e8e069 Fixed: return / if all parameters are empty in $router->getUrl method. 2017-08-22 17:18:48 +01:00
Simon Sessingø b7f5d31544 Fixed double / when calling findUrl on routes with the first
parameter optional.
2017-08-17 23:31:27 +01:00
Simon Sessingø 5086347802 Bugfix: fixed using empty value in url still parsing current
parameters.
2017-08-13 18:01:48 +01:00
Simon Sessingø 74187ee326 Fixes and development
- `$parameter` argument in `findUrl` method now supports both string,
array and null value to avoid confusion.

- Using return value in callbacks now displays value (issue: #257)
2017-08-13 03:06:27 +01:00
Simon Sessingø 62f0075cf3 Fixed wrong url matching on some paths (issue: #253 - thanks @alejoloe007jb) 2017-08-07 22:18:36 +02:00
Simon Sessingø 3c73de866e Added code-comments. 2017-08-01 21:25:44 +02:00
Simon Sessingø 883d8a6b0e Fixes for issue #248 2017-08-01 21:09:18 +02:00
Simon Sessingø 3a7b27796a Url matching fixes 2017-08-01 18:29:47 +02:00
Simon Sessingø 410fa3c9f5 Fixed PHP 5.5 compatibility (issue: #244 - thanks @thexeos) 2017-07-18 11:26:45 +02:00
Simon Sessingø 1ac7761d35 Development
- Optimized `.gitignore`.
- Renamed `XSRF-TOKEN` constant to `CSRF-TOKEN` in `CsrfToken`.
2017-07-08 11:56:57 +02:00
Simon Sessingø 9eb7c5c13c Removed 'name' as it's set as the default value when calling the $getItem function. 2017-07-08 11:49:05 +02:00
Simon Sessingø 5151461a02 Added setMiddleware deprecated method in Route class. 2017-07-08 11:42:27 +02:00
Simon Sessingø b07348a3df Development
- Removed temporary `RouterException` class.
- Added object-types to parameters in `CallbackExceptionHandler` and `SimpleRouter` classes.
- Router now renders groups even if callback is null.
- Renamed `setMiddleware` to `addMiddleware` in `Route` class and `IRoute` interface.
- `addMiddleware` now accept both object and class strings in `Route` class.
- `addExceptionHandler` now accept both object and class strings in `RouteGroup` class.
- Added unit-test for rewrite-exception message change: `testRewriteExceptionMessage` in `RouterRewriteTest`.
- Fixed typo: renamed `testSimularUrls` to `testSimilarUrls` in `RouterUrlTest`.
2017-07-08 11:21:18 +02:00
Simon Sessingø d411b31cc2 Changed message-text thrown in NotFoundHttpException to show redirected routes (issue: #240) 2017-07-06 15:46:09 +02:00
Simon Sessingø ca381d445f Development
- Changed router so it supports both string and object as exception handlers.
- Added `Router::error($callback)` method to `Router` class (issue #238).
- Fixed issues calling `getController` and `getMethod` when callback is an object (issue #239).
- Updated documentation to reflect new changes.
- Added `addExceptionHandler` to `IGroupRoute` interface and `RouteGroup` class.
- Other minor bugfixes and optimisations.
2017-07-06 15:25:04 +02:00
Simon Sessingø 9dd80dd1d9 Development
- Fixed global regex match not working properly.
- Feature: added option to change regular expression used for parameters on routes.
- Added unit-tests for custom parameter regular expression.
- Updated documentation to reflect new features.
2017-05-09 06:43:26 +02:00
Simon Sessingø 8901e7c125 Development
- Added check in `CsrfToken` class to ensure that IV generation is strong and secure.
- Minor optimisations mostly related to PHPDocs and PHPStorm code-inspection.
2017-05-09 02:49:41 +02:00
Simon Sessingø 0a58d36606 Development
- Fixed: `RouteController` not matching certain urls.
- Made `RouteResource` more strict in url-matching.
- Added PHPUnit `RouterControllerTest` class.
- Fixed merged `testSimularUrls` method in `RouterUrlTest`.
2017-03-06 02:53:44 +01:00