From 916b736bd22d739890c593e73a05437d3272e815 Mon Sep 17 00:00:00 2001 From: filip Date: Tue, 10 Feb 2015 22:56:36 +0100 Subject: quick and dirty safety mechanism for file integrity test bug #15252 --- lib.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib.php') 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); } -- cgit v1.2.1