Include trailing slash in REQUEST_URI before compare for prevent caching

This commit is contained in:
Claudio Sanches 2016-11-08 17:14:31 -02:00
parent f23a529329
commit 1481f1f7b4
1 changed files with 1 additions and 2 deletions

View File

@ -165,7 +165,6 @@ class WC_Cache_Helper {
/** /**
* Prevent caching on dynamic pages. * Prevent caching on dynamic pages.
* @access public
*/ */
public static function prevent_caching() { public static function prevent_caching() {
if ( false === ( $wc_page_uris = get_transient( 'woocommerce_cache_excluded_uris' ) ) ) { if ( false === ( $wc_page_uris = get_transient( 'woocommerce_cache_excluded_uris' ) ) ) {
@ -177,7 +176,7 @@ class WC_Cache_Helper {
self::nocache(); self::nocache();
} elseif ( is_array( $wc_page_uris ) ) { } elseif ( is_array( $wc_page_uris ) ) {
foreach ( $wc_page_uris as $uri ) { foreach ( $wc_page_uris as $uri ) {
if ( stristr( $_SERVER['REQUEST_URI'], $uri ) ) { if ( stristr( trailingslashit( $_SERVER['REQUEST_URI'] ), $uri ) ) {
self::nocache(); self::nocache();
break; break;
} }