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.
44The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
55and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
66
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+
717## 1.0.2 - 2018-04-18
818### Updated
919- 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 22 "name" : " dwnload/wp-rest-api-object-cache" ,
33 "description" : " Enable object caching for WordPress' REST API. Aids in increased response times of your applications endpoints." ,
44 "type" : " wordpress-plugin" ,
5- "version" : " 1.0.3 " ,
5+ "version" : " 1.0.4 " ,
66 "license" : " MIT" ,
77 "authors" : [
88 {
Original file line number Diff line number Diff line change @@ -86,11 +86,10 @@ protected function wpCacheDeleteByKey(string $key) : bool
8686 * Return the current REQUEST_URI from the global server variable.
8787 * Don't use `FILTER_SANITIZE_URL` since it will return false when 'http' isn't present.
8888 *
89- * @param string|null $route The request route.
9089 * @return string
9190 */
92- protected function getRequestUri (string $ route = null ) : string
91+ protected function getRequestUri () : string
9392 {
94- return filter_var_string ($ route ?? $ _SERVER ['REQUEST_URI ' ]);
93+ return filter_var_string (wp_unslash ( $ _SERVER ['REQUEST_URI ' ]) );
9594 }
9695}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public function addHooks()
6262 */
6363 public function preDispatch ($ result , WP_REST_Server $ server , WP_REST_Request $ request )
6464 {
65- $ request_uri = $ request -> get_route () ?? $ this ->getRequestUri ();
65+ $ request_uri = $ this ->getRequestUri ();
6666 $ group = $ this ->getCacheGroup ();
6767 $ key = $ this ->getCacheKey ($ request_uri , $ server , $ request );
6868
You can’t perform that action at this time.
0 commit comments