From 1481f1f7b4d7fac7b2dda8bfb44734d3a01c8123 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 8 Nov 2016 17:14:31 -0200 Subject: [PATCH] Include trailing slash in REQUEST_URI before compare for prevent caching --- includes/class-wc-cache-helper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/class-wc-cache-helper.php b/includes/class-wc-cache-helper.php index ddb31834e99..0eec144b8f9 100644 --- a/includes/class-wc-cache-helper.php +++ b/includes/class-wc-cache-helper.php @@ -165,7 +165,6 @@ class WC_Cache_Helper { /** * Prevent caching on dynamic pages. - * @access public */ public static function prevent_caching() { if ( false === ( $wc_page_uris = get_transient( 'woocommerce_cache_excluded_uris' ) ) ) { @@ -177,7 +176,7 @@ class WC_Cache_Helper { self::nocache(); } elseif ( is_array( $wc_page_uris ) ) { foreach ( $wc_page_uris as $uri ) { - if ( stristr( $_SERVER['REQUEST_URI'], $uri ) ) { + if ( stristr( trailingslashit( $_SERVER['REQUEST_URI'] ), $uri ) ) { self::nocache(); break; }