Fallback to "default" and check if directory exists

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2017-12-08 12:28:41 +01:00
parent 8e684f76e5
commit 8ffd4428bb
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 6 additions and 2 deletions

View File

@ -244,7 +244,7 @@ $CONFIG = array(
* skeleton files. * skeleton files.
* ``{lang}`` can be used as a placeholder for the language of the user. * ``{lang}`` can be used as a placeholder for the language of the user.
* If the directory does not exist, it falls back to non dialect (from ``de_DE`` * If the directory does not exist, it falls back to non dialect (from ``de_DE``
* to ``de``). If that does not exist either, it falls back to ``en`` * to ``de``). If that does not exist either, it falls back to ``default``
* *
* Defaults to ``core/skeleton`` in the Nextcloud directory. * Defaults to ``core/skeleton`` in the Nextcloud directory.
*/ */
@ -866,6 +866,7 @@ $CONFIG = array(
/** /**
* custom path for LibreOffice/OpenOffice binary * custom path for LibreOffice/OpenOffice binary
* *
*
* Defaults to ``''`` (empty string) * Defaults to ``''`` (empty string)
*/ */
'preview_libreoffice_path' => '/usr/bin/libreoffice', 'preview_libreoffice_path' => '/usr/bin/libreoffice',

View File

@ -389,7 +389,10 @@ class OC_Util {
$skeletonDirectory = str_replace('{lang}', substr($userLang, 0, $dialectStart), $plainSkeletonDirectory); $skeletonDirectory = str_replace('{lang}', substr($userLang, 0, $dialectStart), $plainSkeletonDirectory);
} }
if ($dialectStart === false || !file_exists($skeletonDirectory)) { if ($dialectStart === false || !file_exists($skeletonDirectory)) {
$skeletonDirectory = str_replace('{lang}', 'en', $plainSkeletonDirectory); $skeletonDirectory = str_replace('{lang}', 'default', $plainSkeletonDirectory);
}
if (!file_exists($skeletonDirectory)) {
$skeletonDirectory = '';
} }
} }