[wp-trac] [WordPress Trac] #10602: if WP_CACHE is defined as false advanced-cache file will still be loaded

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 13 00:55:46 UTC 2009


#10602: if WP_CACHE is defined as false advanced-cache file will still be loaded
--------------------------+-------------------------------------------------
 Reporter:  dandean       |       Owner:  ryan      
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Cache         |     Version:  2.8.3     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 Line 214 of wp-settings.php is prone to confusing people if WP_CACHE is
 set to FALSE (or any othe value that is not TRUE). The IF statement is
 only checking that WP_CACHE is set, not that it is set to TRUE:

 {{{
 if ( defined('WP_CACHE') )
         @include WP_CONTENT_DIR . '/advanced-cache.php';

 }}}

 Something like this would be much better:

 {{{
 if ( defined('WP_CACHE') && WP_CACHE == true )
         @include WP_CONTENT_DIR . '/advanced-cache.php';

 }}}

 This would be even better (pseudo-code... removing "@" from include
 statement), but I understand if it violates other more important concerns:

 {{{
 if ( defined('WP_CACHE') && WP_CACHE == true ) {
     try {
         include WP_CONTENT_DIR . '/advanced-cache.php';
     } catch (Exception $e) {
         die("Advanced cache not configured. " + $e->getMessage());
     }
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10602>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list