Simon Sessingø
e8a1eac167
Development
...
- Moved request-types constants from abstract Route class to global Request-class and changed references.
- Changed code to use new global request-type constants.
- Optimized InputHandler class so it only parses inputs once when calling all-method.
- Forced csrf-token post-value are now availible in all requestTypePost methods.
2021-03-21 14:52:34 +01:00
Simon Sessingø
2ff278baef
Merge branch 'get-csrf-token' of https://github.com/DeveloperMarius/simple-php-router into DeveloperMarius-get-csrf-token
2021-03-21 14:16:20 +01:00
Marius Karstedt
31b4b4673e
add csrf token check for patch
2021-03-21 12:20:57 +01:00
Marius Karstedt
05e5461acb
get csrf token in request; Test for prefix 'http-' in csrf token header
2021-03-21 11:40:37 +01:00
Simon Sessingø
4674dbef1a
Merge branch 'v4-development' into fix-partial-group
2021-03-21 07:57:01 +01:00
Simon Sessingø
d70b153189
[BUGFIX] Fixed issue with child groups not loading when using partialGroups (issue: #456 )
2021-03-21 07:39:17 +01:00
Simon Sessingø
21d180ebc9
[FEATURE] Added support for class hinting on routes as requested by #491
2021-03-21 05:55:18 +01:00
Simon Sessingø
e78040aabd
Fixed existing unit-tests.
2021-03-18 21:58:40 +01:00
Simon Sessingø
252cc4a75d
Optimized InputHandler to better support nested values.
2021-03-18 21:58:12 +01:00
Simon Sessingø
24ef438334
Merge pull request #495 from SimonSchobel/patch-1
...
Fixed bug in getIp
2021-03-18 14:03:39 +01:00
Simon Schøbel
6fc0241bab
Fixed bug in getIp
...
Fixed typo
2021-03-18 08:12:48 +01:00
Simon Sessingø
19b1a14dec
Parameters are by default now using regex [\w\-]+ (supports dashes) to avoid confusion.
2021-03-18 03:24:47 +01:00
Simon Sessingø
fb726c3613
Issue #437 : Fixed CSRF-token returning null on first refresh after cookies are removed.
2021-03-18 02:50:06 +01:00
Simon Sessingø
ff8ef9d412
Merge branch 'v4-development' of github.com:skipperbent/simple-php-router into v4-development
2021-03-17 20:20:56 +01:00
Simon Sessingø
ca88e86c3d
Development
...
- Removed unused exception from PHP-docs.
- Fixed types not same as declared.
- Fixed issues with reg-ex and php-unit tests.
- Removed unnecessary type casting.
- Declared functions as static (better scoping + performance).
- Moved `\is_callable($callback) === false` as the execution costs less than previous in `Router.php`.
- Changed `ob_get_contents` to `ob_get_clean`.
- Added type hints to methods.
2021-03-17 20:20:28 +01:00
Simon Sessingø
5a24dfd4a1
Merge pull request #461 from b3none/master
...
Alter behaviour of input()->all when a filter is passed.
2021-03-17 19:25:51 +01:00
Simon Sessingø
891c2092eb
Changed codestyle to match the rest
2021-03-17 19:25:18 +01:00
Simon Sessingø
845ef9db69
Merge pull request #450 from RedooNetworks/master
...
Fix warning, because of wrong calculated cookie expiration timestamp
2021-03-17 19:17:01 +01:00
Simon Sessingø
ce3a2014d1
Merge pull request #449 from jatubio/patch-4
...
Fix 'must be an instance of Closure, array given' error when $closure is a object method.
2021-03-17 19:12:00 +01:00
Simon Sessingø
27cd8b8a1f
Added support for objects like array etc as default-value. Value is now less strict.
2021-03-17 15:43:00 +01:00
Alex Blackham
93c0622b9d
Altered variable name in foreach to be less ambiguous.
2019-06-21 10:45:57 +01:00
Alex Blackham
572ba1695b
The input()->all method will now set every key specified in the filter. If the key doesn't exist it will be set to null.
2019-06-21 10:44:31 +01:00
Stefan Warnat
11df7ca18c
Fix warning, because of wrong calculated cookie expiration timestamp
2019-02-09 11:04:07 +01:00
Juan Antonio Tubio
b21feca1fc
Update IClassLoader.php
...
Fix 'must be an instance of Closure, array given' error when $closure is a object method.
2019-02-08 21:40:04 +01:00
Juan Antonio Tubio
2a3238f30a
Update ClassLoader.php
...
Fix 'must be an instance of Closure, array given' error when $closure is a object method.
2019-02-08 21:36:58 +01:00
Simon Sessingø
d601e8eca3
Bugfixes and optimisations.
...
- Fix for __invoke methods (issue: #429 )
- Fixed not being able to parse body of PUT request.
- BaseCsrfVerifier expects the field name to be "csrf-token" (issue: #432 )
- Minor optimisations
2018-11-25 00:44:20 +01:00
Simon Sessingø
4a8b71a0b5
Merge pull request #430 from Tahrz/master
...
fix for __invoke methods (if there are only in class (Action))
2018-11-25 00:27:54 +01:00
Matheus
d4a6d504b1
Set HTTP method before initializing InputHandler
...
This is needed because without it the InputHandler doesn't know which http method is being used, and because of that it can't parse the body of a PUT request
2018-11-10 22:16:45 -02:00
Taras Victorovich
9e3b1b6baa
fix for __invoke methods (if there are only in class (Action))
2018-10-02 15:40:26 +03:00
Simon Sessingø
0ac7fd559a
Optimizations
...
- Settings parameter in group method are no longer optional.
- Updated README to contain PHP JSON-extension under requirements.
- Updated composer.json to include php json extension.
2018-08-31 01:40:21 +02:00
Simon Sessingø
5c2a973214
Merge branch 'v4-development' into v4-optional-character-fix
2018-08-24 17:23:33 +02:00
Simon Sessingø
a7cbacbde7
Fix for issue #421 : Incorrectly optional character in route
2018-08-24 17:16:02 +02:00
Simon Sessingo
4d842d0583
Fixed returning empty array when positing json (issue #413 )
2018-04-22 05:35:15 +02:00
Simon Sessingø
8653bfa86f
Development
...
- Fixed 403 not allowed exception is now thrown as NotFoundHttpException.
- Added REQUEST_TYPE_HEAD to Route class.
- Minor optimizations.
2018-04-06 19:44:30 +02:00
Simon Sessingø
b8cfc4eb0b
Fixed default parameter for all method allowed to by empty.
2018-04-06 18:01:49 +02:00
Simon Sessingø
5db4621831
Added methods for adding get, post and file parameters manually.
2018-04-06 18:00:59 +02:00
Simon Sessingø
d38f81836d
Development
...
- Added new Redirect method to SimpleRouter class.
- Changed method-names in InputHandler for better description.
- Fixed return-types for InputHandler for collections.
- Added unit-tests for InputHandler (get, post).
- Optimisations.
2018-04-06 17:20:00 +02:00
Simon Sessingø
30a2ddeed9
Development
...
- Added new event when adding route.
- Added `prependUrl` method to `LoadableRoute` class.
- Added unit-test for add-route event.
- Updated documentation to reflect new changes.
2018-04-02 14:53:36 +02:00
Simon Sessingø
17a7b28e82
Fixed exists method in InputHandler returning incorrect value.
2018-04-01 04:26:48 +02:00
Simon Sessingø
1dc88d23e1
Bugfixes and optimizations
...
- Fixed `hasParam` not working returning expected value in `Url` class.
- Chained the remaining methods in the `Url` class.
- Simplified `removeParam` method in `Url` class.
- Added new `removeParams` method to `Url` class for removal of multiple params.
2018-04-01 03:02:21 +02:00
Simon Sessingø
53f0b7d8e2
- Fixed getName method in LoadableRoute class can contain nullable value.
2018-03-30 06:47:27 +02:00
Simon Sessingø
833961ddc3
Fixed getError in InputFile returning string instead of int.
2018-03-30 05:37:04 +02:00
Simon Sessingø
ce63e247b1
Bugfixes
...
- Fixed `Url` not outputting correct class when used in json_encode.
- Fixed `IInputItem` being too strict about strings which may be nullable.
2018-03-30 05:22:41 +02:00
Simon Sessingø
80a42030ea
Bugfixes
...
- Fixed getting specific input-value by request-method in InputHandler.
- Added .idea files
2018-03-29 23:47:27 +02:00
Simon Sessingø
17471a53cd
Removed namespace from groups
2018-03-29 23:28:03 +02:00
Simon Sessingø
da219d0b19
Bugfixes
...
- Fixed rewrite from ExceptionHandler sometimes not working correctly.
- Fixed default-namespace for Group and partial groups.
2018-03-29 23:13:56 +02:00
Simon Sessingø
a11595fb86
Bugfixes
...
- Fixed `$methods` argument not properly passed in `InputHandler` class.
- Updated helpers.php with latest changes.
2018-03-29 22:17:53 +02:00
Simon Sessingø
e6db83c97a
Fixed defaultValue issue in getValue method in InputHandler class.
2018-03-29 21:44:41 +02:00
Simon Sessingø
af2ac6031d
Development
...
- Added dependency injection support.
- Added php-di composer dependency.
- Added `ClassLoader` class.
- Added `IClassLoader` interface.
- Added unit-tests for dependency injection.
- Updated documentation to reflect new features.
2018-03-29 21:16:02 +02:00
Simon Sessingø
f5a023117a
Development
...
- Added event-arguments data.
- Added event-arguments to the event list in documentation.
- Fixed missing exceptions thrown in phpDocs.
- Added unit-tests for new event functionality.
2018-03-29 18:51:28 +02:00