aboutsummaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2015-02-10 22:56:36 +0100
committerfilip <filip.komar@gmail.com>2015-02-10 22:56:36 +0100
commit916b736bd22d739890c593e73a05437d3272e815 (patch)
tree8a3b89ff6cbda3d7bf1a97fcf317ede8ea052608 /lib.php
parent76cba1e794e7d8a5049d83b9bfdd0375ddb540eb (diff)
downloadnav-916b736bd22d739890c593e73a05437d3272e815.tar
nav-916b736bd22d739890c593e73a05437d3272e815.tar.gz
nav-916b736bd22d739890c593e73a05437d3272e815.tar.bz2
nav-916b736bd22d739890c593e73a05437d3272e815.tar.xz
nav-916b736bd22d739890c593e73a05437d3272e815.zip
quick and dirty safety mechanism for file integrity test bug #15252
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);
}