diff --git a/src/mibew/libs/common/locale.php b/src/mibew/libs/common/locale.php index a2b194b7..ea94fc83 100644 --- a/src/mibew/libs/common/locale.php +++ b/src/mibew/libs/common/locale.php @@ -202,6 +202,9 @@ function read_locale_file($path) { $messages = array(); $fp = fopen($path, "r"); + if ($fp === FALSE) { + die("unable to read locale file $path"); + } while (!feof($fp)) { $line = fgets($fp, 4096); // Try to get key and value from locale file line diff --git a/src/mibew/operator/translate.php b/src/mibew/operator/translate.php index 781f0601..70a991fb 100644 --- a/src/mibew/operator/translate.php +++ b/src/mibew/operator/translate.php @@ -58,6 +58,9 @@ function save_message($locale, $key, $value) $added = false; $current_encoding = $mibew_encoding; $fp = fopen(dirname(dirname(__FILE__))."/locales/$locale/properties", "r"); + if ($fp === FALSE) { + die("unable to open properties for locale $locale"); + } while (!feof($fp)) { $line = fgets($fp, 4096); $keyval = preg_split("/=/", $line, 2);