PluginProbe
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score / 3.6.3
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score v3.6.3
trunk 1.0 1.0.1 1.1 1.1.1 1.1.2 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1 2.1.1 2.1.2 2.2 2.2.1 All 69 releases
← All changes | includes/classes/ObjectCache.php +9 -3 2.03.6.3 View file →
@@ -89,24 +89,30 @@
89 89 *
90 90 * @since 1.0
91 91 */
92 92 public function purge_object_cache() {
93 - if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'powered_cache_purge_object_cache' ) ) {
93 + if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'powered_cache_purge_object_cache' ) ) { // phpcs:ignore
94 94 wp_nonce_ays( '' );
95 95 }
96 96
97 97 if ( is_multisite() && ! current_user_can( 'manage_network' ) ) {
98 98 $redirect_url = add_query_arg( 'pc_action', 'flush_object_cache_err_permission', wp_get_referer() );
99 - wp_safe_redirect( $redirect_url );
99 + wp_safe_redirect( esc_url_raw( $redirect_url ) );
100 100 exit;
101 101 }
102 102
103 + if ( ! current_user_can( 'manage_options' ) ) {
104 + $redirect_url = add_query_arg( 'pc_action', 'flush_object_cache_err_permission', wp_get_referer() );
105 + wp_safe_redirect( esc_url_raw( $redirect_url ) );
106 + exit;
107 + }
108 +
103 109 if ( function_exists( 'wp_cache_flush' ) ) {
104 110 wp_cache_flush();
105 111 }
106 112
107 113 $redirect_url = add_query_arg( 'pc_action', 'flush_object_cache', wp_get_referer() );
108 - wp_safe_redirect( $redirect_url );
114 + wp_safe_redirect( esc_url_raw( $redirect_url ) );
109 115 exit;
110 116 }
111 117
112 118