diff --git a/core/app/Subs-CachePHP.php b/core/app/Subs-CachePHP.php index 44c5a5cd..611a1f28 100644 --- a/core/app/Subs-CachePHP.php +++ b/core/app/Subs-CachePHP.php @@ -15,7 +15,7 @@ // Build the cached version of our source file function cache_source_file($source, $dest) { - $dest_locked = substr($dest, 0, -4).'-'.mt_rand(10000, 99999).'.php'; + $dest_locked = substr($dest, 0, -4) . '-' . mt_rand(999, 999999999) . '.php'; apply_plugin_mods($source, $dest_locked); minify_php($dest_locked); rename($dest_locked, $dest); diff --git a/index.php b/index.php index 478b0bae..e671bac5 100644 --- a/index.php +++ b/index.php @@ -181,10 +181,10 @@ function loadSource($source_name) else { $cache = ROOT_DIR . '/gz/app/' . str_replace(array('/', '..'), array('_', 'UP'), $file) . '.php'; - if (!file_exists($cache) || filemtime($cache) < filemtime(APP_DIR . '/' . $file . '.php')) + if (!file_exists($cache) || filemtime($cache) < filemtime($dest = APP_DIR . '/' . $file . '.php')) { loadSource('Subs-CachePHP'); - cache_source_file(APP_DIR . '/' . $file . '.php', $cache); + cache_source_file($dest, $cache); } } require_once($cache); @@ -256,13 +256,7 @@ function determine_action($action) loadSource($target[0]); // Remember, if the function is the same as the filename, you may declare it just once. - $func_name = isset($target[1]) ? $target[1] : $target[0]; - - if (is_callable($func_name)) - return $func_name; - - log_error('An error occurred while loading a file. ' . print_r($target, true) . ' -- filesize: ' . filesize(APP_DIR . '/' . $target[0] . '.php')); - return index_action('fallback_action'); + return isset($target[1]) ? $target[1] : $target[0]; } function index_action($hook_action = 'default_action')