mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-01 05:44:41 +03:00
Add missed checks for the failed file openings
This commit is contained in:
parent
a2bfeb72a7
commit
b2f43076aa
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user