WordPress.org

Plugin Directory

Changeset 698463


Ignore:
Timestamp:
04/16/13 11:31:10 (12 months ago)
Author:
donncha
Message:

Re-org the comment check regex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-super-cache/trunk/wp-cache-phase1.php

    r609482 r698463  
    338338function wp_cache_get_cookies_values() { 
    339339    $string = ''; 
     340    $regex = "/^wp-postpass|^comment_author_"; 
    340341    if ( defined( 'LOGGED_IN_COOKIE' ) ) 
    341         $logged_in_cookie = preg_quote( constant( 'LOGGED_IN_COOKIE' ) ); 
    342     else     
    343         $logged_in_cookie = 'wordpress_logged_in'; 
     342        $regex .= "|^" . preg_quote( constant( 'LOGGED_IN_COOKIE' ) ); 
     343    else 
     344        $regex .= "|^wordpress_logged_in_"; 
     345    $regex .= "/"; 
    344346    while ($key = key($_COOKIE)) { 
    345         if ( preg_match( "/^wp-postpass|^" . $logged_in_cookie . "|^comment_author_/", $key ) ) { 
    346             if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Cookie detected: $key", 5 ); 
     347        if ( preg_match( $regex, $key ) ) { 
     348            if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_get_cookies_values: $regex Cookie detected: $key", 5 ); 
    347349            $string .= $_COOKIE[ $key ] . ","; 
    348350        } 
Note: See TracChangeset for help on using the changeset viewer.