Changeset 166247
- Timestamp:
- 10/23/2009 10:11:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cache-translation-object/trunk/cache-translation-object.php
r166142 r166247 103 103 global $l10n, $cache_translation_cached; 104 104 105 if (!cachet_handle_this_call() || empty($locale)) 106 return $locale; 107 105 108 if ($cache_translation_cached) { 106 109 /* We have already restored a cached translation object */ … … 181 184 182 185 186 /* Only handle calls from the load_*_textdomain functions */ 187 function cachet_handle_this_call() { 188 $whitelist = Array('load_default_textdomain', 'load_plugin_textdomain', 'load_theme_textdomain'); 189 190 if (!is_callable('debug_backtrace')) 191 return true; 192 193 $bt = debug_backtrace(); 194 foreach ( (array) $bt as $call ) { 195 if ( in_array($call['function'], $whitelist) ) 196 return true; 197 } 198 199 return false; 200 } 201 202 183 203 /* 184 204 * Store the complete translation object at shutdown (once).
Note: See TracChangeset
for help on using the changeset viewer.