diff options
Diffstat (limited to 'lib/private/legacy/util.php')
-rw-r--r-- | lib/private/legacy/util.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 2fc6ba52d4e..5cc83c0c304 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -379,7 +379,23 @@ class OC_Util { */ public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) { - $skeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); + $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); + $userLang = \OC::$server->getL10NFactory()->findLanguage(); + $skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory); + + if (!file_exists($skeletonDirectory)) { + $dialectStart = strpos($userLang, '_'); + if ($dialectStart !== false) { + $skeletonDirectory = str_replace('{lang}', substr($userLang, 0, $dialectStart), $plainSkeletonDirectory); + } + if ($dialectStart === false || !file_exists($skeletonDirectory)) { + $skeletonDirectory = str_replace('{lang}', 'default', $plainSkeletonDirectory); + } + if (!file_exists($skeletonDirectory)) { + $skeletonDirectory = ''; + } + } + $instanceId = \OC::$server->getConfig()->getSystemValue('instanceid', ''); if ($instanceId === null) { |