]> source.dussan.org Git - nextcloud-server.git/commitdiff
Kill another unneeded translation 21761/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 8 Jul 2020 19:47:16 +0000 (21:47 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 8 Jul 2020 19:47:16 +0000 (21:47 +0200)
We should only translate things when we actually need them.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/legacy/OC_Util.php

index ae1b28d5bb0bdc6ecc14e29e2b58935a6fc5255d..8d2bf477d529526800d2f00f7bf901fd8f357e18 100644 (file)
@@ -998,23 +998,21 @@ class OC_Util {
                if (\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) {
                        return  [];
                }
-               $l = \OC::$server->getL10N('lib');
-               $errors = [];
-               $permissionsModHint = $l->t('Please change the permissions to 0770 so that the directory'
-                       . ' cannot be listed by other users.');
+
                $perms = substr(decoct(@fileperms($dataDirectory)), -3);
                if (substr($perms, -1) !== '0') {
                        chmod($dataDirectory, 0770);
                        clearstatcache();
                        $perms = substr(decoct(@fileperms($dataDirectory)), -3);
                        if ($perms[2] !== '0') {
-                               $errors[] = [
+                               $l = \OC::$server->getL10N('lib');
+                               return [
                                        'error' => $l->t('Your data directory is readable by other users'),
-                                       'hint' => $permissionsModHint
+                                       'hint' => $l->t('Please change the permissions to 0770 so that the directory cannot be listed by other users.'),
                                ];
                        }
                }
-               return $errors;
+               return [];
        }
 
        /**