Translation of semantics now working

namespaces
Svein-Tore Griff With 2013-05-03 11:21:08 +02:00
parent 2edb9a6b3f
commit da99000fe8
1 changed files with 5 additions and 2 deletions

View File

@ -455,11 +455,14 @@ class H5PValidator {
if (is_dir($languagePath)) { if (is_dir($languagePath)) {
$languageFiles = scandir($languagePath); $languageFiles = scandir($languagePath);
foreach ($languageFiles as $languageFile) { foreach ($languageFiles as $languageFile) {
if (preg_match('/^(-?[a-z]+){1,7}\.json$/i', $file) === 0) { if (in_array($languageFile, array('.', '..'))) {
continue;
}
if (preg_match('/^(-?[a-z]+){1,7}\.json$/i', $languageFile) === 0) {
$this->h5pF->setErrorMessage($this->h5pF->t('Invalid language file %file in library %library', array('%file' => $languageFile, '%library' => $file))); $this->h5pF->setErrorMessage($this->h5pF->t('Invalid language file %file in library %library', array('%file' => $languageFile, '%library' => $file)));
return FALSE; return FALSE;
} }
$languageJson = $this->getJsonData($languageFile, TRUE); $languageJson = $this->getJsonData($languagePath . DIRECTORY_SEPARATOR . $languageFile, TRUE);
if ($languageJson === FALSE) { if ($languageJson === FALSE) {
$this->h5pF->setErrorMessage($this->h5pF->t('Invalid language file %languageFile has been included in the library %name', array('%languageFile' => $languageFile, '%name' => $file))); $this->h5pF->setErrorMessage($this->h5pF->t('Invalid language file %languageFile has been included in the library %name', array('%languageFile' => $languageFile, '%name' => $file)));
return FALSE; return FALSE;