Version Description
- Update sanitization
Download this release
Release Info
Developer | keycdn |
Plugin | Cache Enabler – WordPress Cache |
Version | 1.8.9 |
Comparing to | |
See all releases |
Code changes from version 1.8.8 to 1.8.9
- cache-enabler.php +2 -2
- inc/cache_enabler_engine.class.php +8 -13
- readme.txt +6 -3
cache-enabler.php
CHANGED
@@ -6,11 +6,11 @@ Description: Simple and fast WordPress caching plugin.
|
|
6 |
Author: KeyCDN
|
7 |
Author URI: https://www.keycdn.com
|
8 |
License: GPLv2 or later
|
9 |
-
Version: 1.8.
|
10 |
*/
|
11 |
|
12 |
/*
|
13 |
-
Copyright (C)
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
6 |
Author: KeyCDN
|
7 |
Author URI: https://www.keycdn.com
|
8 |
License: GPLv2 or later
|
9 |
+
Version: 1.8.9
|
10 |
*/
|
11 |
|
12 |
/*
|
13 |
+
Copyright (C) 2022 KeyCDN
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
inc/cache_enabler_engine.class.php
CHANGED
@@ -196,7 +196,7 @@ final class Cache_Enabler_Engine {
|
|
196 |
* Get the required HTTP request headers from the current request.
|
197 |
*
|
198 |
* @since 1.7.0
|
199 |
-
* @change 1.8.
|
200 |
*
|
201 |
* @return string[] An array of HTTP request headers with names as the keys.
|
202 |
*/
|
@@ -209,20 +209,15 @@ final class Cache_Enabler_Engine {
|
|
209 |
$request_headers = function_exists( 'apache_request_headers' ) ? apache_request_headers() : array();
|
210 |
|
211 |
$request_headers = array(
|
212 |
-
'Accept' => isset( $request_headers['Accept'] ) ? $request_headers['Accept'] : ( isset( $_SERVER['HTTP_ACCEPT'] ) ? $_SERVER['HTTP_ACCEPT'] : '' ),
|
213 |
-
'Accept-Encoding' => isset( $request_headers['Accept-Encoding'] ) ? $request_headers['Accept-Encoding'] : ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : '' ),
|
214 |
-
'Host' => isset( $request_headers['Host'] ) ? $request_headers['Host'] : ( isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER[ 'HTTP_HOST' ] : '' ),
|
215 |
-
'If-Modified-Since' => isset( $request_headers['If-Modified-Since'] ) ? $request_headers['If-Modified-Since'] : ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : '' ),
|
216 |
-
'User-Agent' => isset( $request_headers['User-Agent'] ) ? $request_headers['User-Agent'] : ( isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '' ),
|
217 |
-
'X-Forwarded-Proto' => isset( $request_headers['X-Forwarded-Proto'] ) ? $request_headers['X-Forwarded-Proto'] : ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ? $_SERVER['HTTP_X_FORWARDED_PROTO'] : '' ),
|
218 |
-
'X-Forwarded-Scheme' => isset( $request_headers['X-Forwarded-Scheme'] ) ? $request_headers['X-Forwarded-Scheme'] : ( isset( $_SERVER['HTTP_X_FORWARDED_SCHEME'] ) ? $_SERVER['HTTP_X_FORWARDED_SCHEME'] : '' ),
|
219 |
);
|
220 |
|
221 |
-
// Sanitize request header values
|
222 |
-
foreach ($request_headers as $key => $value) {
|
223 |
-
$request_headers[$key] = self::sanitize_server_input( $value );
|
224 |
-
}
|
225 |
-
|
226 |
return $request_headers;
|
227 |
}
|
228 |
|
196 |
* Get the required HTTP request headers from the current request.
|
197 |
*
|
198 |
* @since 1.7.0
|
199 |
+
* @change 1.8.9
|
200 |
*
|
201 |
* @return string[] An array of HTTP request headers with names as the keys.
|
202 |
*/
|
209 |
$request_headers = function_exists( 'apache_request_headers' ) ? apache_request_headers() : array();
|
210 |
|
211 |
$request_headers = array(
|
212 |
+
'Accept' => isset( $request_headers['Accept'] ) ? self::sanitize_server_input( $request_headers['Accept'] ) : ( isset( $_SERVER['HTTP_ACCEPT'] ) ? self::sanitize_server_input( $_SERVER['HTTP_ACCEPT'] ) : '' ),
|
213 |
+
'Accept-Encoding' => isset( $request_headers['Accept-Encoding'] ) ? self::sanitize_server_input( $request_headers['Accept-Encoding'] ) : ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ? self::sanitize_server_input( $_SERVER['HTTP_ACCEPT_ENCODING'] ) : '' ),
|
214 |
+
'Host' => isset( $request_headers['Host'] ) ? self::sanitize_server_input( $request_headers['Host'] ) : ( isset( $_SERVER['HTTP_HOST'] ) ? self::sanitize_server_input( $_SERVER[ 'HTTP_HOST' ] ) : '' ),
|
215 |
+
'If-Modified-Since' => isset( $request_headers['If-Modified-Since'] ) ? self::sanitize_server_input( $request_headers['If-Modified-Since'] ) : ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? self::sanitize_server_input( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) : '' ),
|
216 |
+
'User-Agent' => isset( $request_headers['User-Agent'] ) ? self::sanitize_server_input( $request_headers['User-Agent'] ) : ( isset( $_SERVER['HTTP_USER_AGENT'] ) ? self::sanitize_server_input( $_SERVER['HTTP_USER_AGENT'] ) : '' ),
|
217 |
+
'X-Forwarded-Proto' => isset( $request_headers['X-Forwarded-Proto'] ) ? self::sanitize_server_input( $request_headers['X-Forwarded-Proto'] ) : ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ? self::sanitize_server_input( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) : '' ),
|
218 |
+
'X-Forwarded-Scheme' => isset( $request_headers['X-Forwarded-Scheme'] ) ? self::sanitize_server_input( $request_headers['X-Forwarded-Scheme'] ) : ( isset( $_SERVER['HTTP_X_FORWARDED_SCHEME'] ) ? self::sanitize_server_input( $_SERVER['HTTP_X_FORWARDED_SCHEME'] ) : '' ),
|
219 |
);
|
220 |
|
|
|
|
|
|
|
|
|
|
|
221 |
return $request_headers;
|
222 |
}
|
223 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Cache Enabler ===
|
2 |
Contributors: keycdn
|
3 |
Tags: cache, caching, performance, webp, gzip, brotli, mobile, speed
|
4 |
-
Requires at least: 5.1
|
5 |
Tested up to: 6.0
|
|
|
|
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -29,7 +29,7 @@ Cache Enabler is a simple, yet powerful WordPress caching plugin that is easy to
|
|
29 |
* Real-time cache size display in the WordPress dashboard
|
30 |
* Custom post type support
|
31 |
* `304 Not Modified` support
|
32 |
-
* Works perfectly with [Autoptimize](https://wordpress.org/plugins/autoptimize/)
|
33 |
|
34 |
|
35 |
= How does the caching work? =
|
@@ -55,6 +55,9 @@ Cache Enabler captures page contents and saves it as a static HTML file on the s
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
|
|
|
|
|
|
58 |
= 1.8.8 =
|
59 |
* Add server input sanitization
|
60 |
|
1 |
=== Cache Enabler ===
|
2 |
Contributors: keycdn
|
3 |
Tags: cache, caching, performance, webp, gzip, brotli, mobile, speed
|
|
|
4 |
Tested up to: 6.0
|
5 |
+
Stable tag: 1.8.9
|
6 |
+
Requires at least: 5.1
|
7 |
Requires PHP: 5.6
|
|
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
29 |
* Real-time cache size display in the WordPress dashboard
|
30 |
* Custom post type support
|
31 |
* `304 Not Modified` support
|
32 |
+
* Works perfectly with [Autoptimize](https://wordpress.org/plugins/autoptimize/)
|
33 |
|
34 |
|
35 |
= How does the caching work? =
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
= 1.8.9 =
|
59 |
+
* Update sanitization
|
60 |
+
|
61 |
= 1.8.8 =
|
62 |
* Add server input sanitization
|
63 |
|