aboutsummaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib.php b/lib.php
index 0f8a5ed..0f28859 100644
--- a/lib.php
+++ b/lib.php
@@ -184,12 +184,20 @@ class l10n
$po_file = __DIR__ . '/langs/' . $lang . '.po';
$cache_file = __DIR__ . '/var/tmp/cache/nav_lang_' . $lang . '.php';
- $po_ts = filemtime($po_file);
+ $_ts = 0;
+ $po_ts = 0;
+ if (file_exists($po_file)) {
+ $po_ts = filemtime($po_file);
+ }
if (file_exists($cache_file)) {
- include $cache_file;
- if ($_ts > $po_ts)
- return;
+ // quick and dirty safety mechanism for file integrity test bug #15252
+ if ('$eof = TRUE;' == substr(php_strip_whitespace($cache_file), -12)) {
+ include $cache_file;
+ if ($_ts > $po_ts) {
+ return;
+ }
+ }
}
if (file_exists($po_file)) {
@@ -216,6 +224,8 @@ class l10n
// $lang strings
global \$_t;
\$_t = $_t_data;
+
+\$eof = TRUE;
P;
file_put_contents($cache_file, $cache);
}