Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Handle empty or incorrect lines in a language CSV #15287

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
four and 75/100,4.75
four and 5/10,4.50
four and 5/10,4.50

4 changes: 3 additions & 1 deletion lib/internal/Magento/Framework/App/Language/Dictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ private function readPackCsv($vendor, $package)
foreach ($foundCsvFiles as $foundCsvFile) {
$file = $directoryRead->openFile($foundCsvFile);
while (($row = $file->readCsv()) !== false) {
$result[$row[0]] = $row[1];
if (is_array($row) && count($row) > 1) {
$result[$row[0]] = $row[1];
}
}
}
}
Expand Down