File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
5
5
and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
6
6
7
+ ## 1.0.4 - 2018-04-19
8
+ ### Updated
9
+ - ` RestDispatch::preDispatch ` should set the $request_uri from ` CacheApiTrait::getRequestUri ` and not use
10
+ ` WP_REST_Request::get_route ` to avoid query parameters getting stripped out of the cache request.
11
+ - ` CacheApiTrait::getRequestUri ` to sanitize the REQUEST_URI
12
+
13
+ ## 1.0.3 - 2018-04-18
14
+ ### Updated
15
+ - Bumped [ thefrosty/wp-utilities] ( https://github.com/thefrosty/wp-utilities/ ) to version 1.1.3
16
+
7
17
## 1.0.2 - 2018-04-18
8
18
### Updated
9
19
- Bumped [ thefrosty/wp-utilities] ( https://github.com/thefrosty/wp-utilities/ ) to version 1.1.2
Original file line number Diff line number Diff line change 2
2
"name" : " dwnload/wp-rest-api-object-cache" ,
3
3
"description" : " Enable object caching for WordPress' REST API. Aids in increased response times of your applications endpoints." ,
4
4
"type" : " wordpress-plugin" ,
5
- "version" : " 1.0.3 " ,
5
+ "version" : " 1.0.4 " ,
6
6
"license" : " MIT" ,
7
7
"authors" : [
8
8
{
Original file line number Diff line number Diff line change @@ -86,11 +86,10 @@ protected function wpCacheDeleteByKey(string $key) : bool
86
86
* Return the current REQUEST_URI from the global server variable.
87
87
* Don't use `FILTER_SANITIZE_URL` since it will return false when 'http' isn't present.
88
88
*
89
- * @param string|null $route The request route.
90
89
* @return string
91
90
*/
92
- protected function getRequestUri (string $ route = null ) : string
91
+ protected function getRequestUri () : string
93
92
{
94
- return filter_var_string ($ route ?? $ _SERVER ['REQUEST_URI ' ]);
93
+ return filter_var_string (wp_unslash ( $ _SERVER ['REQUEST_URI ' ]) );
95
94
}
96
95
}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public function addHooks()
62
62
*/
63
63
public function preDispatch ($ result , WP_REST_Server $ server , WP_REST_Request $ request )
64
64
{
65
- $ request_uri = $ request -> get_route () ?? $ this ->getRequestUri ();
65
+ $ request_uri = $ this ->getRequestUri ();
66
66
$ group = $ this ->getCacheGroup ();
67
67
$ key = $ this ->getCacheKey ($ request_uri , $ server , $ request );
68
68
You can’t perform that action at this time.
0 commit comments