mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-08 08:44:40 +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();
|
$messages = array();
|
||||||
|
|
||||||
$fp = fopen($path, "r");
|
$fp = fopen($path, "r");
|
||||||
|
if ($fp === FALSE) {
|
||||||
|
die("unable to read locale file $path");
|
||||||
|
}
|
||||||
while (!feof($fp)) {
|
while (!feof($fp)) {
|
||||||
$line = fgets($fp, 4096);
|
$line = fgets($fp, 4096);
|
||||||
// Try to get key and value from locale file line
|
// Try to get key and value from locale file line
|
||||||
|
@ -58,6 +58,9 @@ function save_message($locale, $key, $value)
|
|||||||
$added = false;
|
$added = false;
|
||||||
$current_encoding = $mibew_encoding;
|
$current_encoding = $mibew_encoding;
|
||||||
$fp = fopen(dirname(dirname(__FILE__))."/locales/$locale/properties", "r");
|
$fp = fopen(dirname(dirname(__FILE__))."/locales/$locale/properties", "r");
|
||||||
|
if ($fp === FALSE) {
|
||||||
|
die("unable to open properties for locale $locale");
|
||||||
|
}
|
||||||
while (!feof($fp)) {
|
while (!feof($fp)) {
|
||||||
$line = fgets($fp, 4096);
|
$line = fgets($fp, 4096);
|
||||||
$keyval = preg_split("/=/", $line, 2);
|
$keyval = preg_split("/=/", $line, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user