summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-28 11:22:25 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-28 11:22:25 +0200
commit557b4a2cb0ae0367e5facb1e4be136de07ab8cff (patch)
tree7381b461888007f72115309376538c42cd44a207
parentde8c15e1a46e33a20af1bad97a8cf27fced84539 (diff)
parentaa2bd28a6a7f3b59eb1dd57a22e8aa4f8e1cab2c (diff)
downloadnextcloud-server-557b4a2cb0ae0367e5facb1e4be136de07ab8cff.tar.gz
nextcloud-server-557b4a2cb0ae0367e5facb1e4be136de07ab8cff.zip
Merge pull request #15892 from owncloud/fix-failed-require-in-l10n-createjs
handle case where the given language is unknown - refs #15794
-rw-r--r--core/command/l10n/createjs.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/command/l10n/createjs.php b/core/command/l10n/createjs.php
index 0411c2f01d9..78f3229b179 100644
--- a/core/command/l10n/createjs.php
+++ b/core/command/l10n/createjs.php
@@ -28,6 +28,7 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use UnexpectedValueException;
class CreateJs extends Command {
@@ -126,6 +127,9 @@ class CreateJs extends Command {
$phpFile = "$path/l10n/$lang.php";
$TRANSLATIONS = array();
$PLURAL_FORMS = '';
+ if (!file_exists($phpFile)) {
+ throw new UnexpectedValueException("PHP translation file <$phpFile> does not exist.");
+ }
require $phpFile;
return array($TRANSLATIONS, $PLURAL_FORMS);