Skip to content

Commit

Permalink
Set escape parameter of fgetcsv() explicitly
Browse files Browse the repository at this point in the history
As of PHP 8.4.0, depending on the default value of escape is deprecated.
  • Loading branch information
W0rma committed Dec 3, 2024
1 parent d8f5eab commit de4a110
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ public static function load($code)
self::$list = array();
$handle = fopen($file, 'r');
while (!feof($handle)) {
$line = fgetcsv($handle);
if (PHP_VERSION >= 80400) {
// As of PHP 8.4.0, depending on the default value of escape is deprecated.
$line = fgetcsv($handle, null, ',', '"', '\\');
} else {
$line = fgetcsv($handle);
}
if (!is_array($line) || count($line) !=2) {
continue;
}
Expand Down

0 comments on commit de4a110

Please sign in to comment.