diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/l10n/ja.js | 1 | ||||
-rw-r--r-- | lib/l10n/ja.json | 1 | ||||
-rw-r--r-- | lib/l10n/ru.js | 2 | ||||
-rw-r--r-- | lib/l10n/ru.json | 2 | ||||
-rw-r--r-- | lib/l10n/zh_CN.js | 8 | ||||
-rw-r--r-- | lib/l10n/zh_CN.json | 8 | ||||
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 25 | ||||
-rw-r--r-- | lib/private/Lock/DBLockingProvider.php | 13 |
8 files changed, 50 insertions, 10 deletions
diff --git a/lib/l10n/ja.js b/lib/l10n/ja.js index 8359ff4cf06..3a8c864e2c5 100644 --- a/lib/l10n/ja.js +++ b/lib/l10n/ja.js @@ -74,6 +74,7 @@ OC.L10N.register( "Security" : "セキュリティ", "Additional settings" : "追加設定", "Personal info" : "個人情報", + "Mobile & desktop" : "モバイル & デスクトップ", "Unlimited" : "無制限", "Verifying" : "検証中", "Verifying …" : "検証中", diff --git a/lib/l10n/ja.json b/lib/l10n/ja.json index 5aaef738ee0..6c93cd8c05e 100644 --- a/lib/l10n/ja.json +++ b/lib/l10n/ja.json @@ -72,6 +72,7 @@ "Security" : "セキュリティ", "Additional settings" : "追加設定", "Personal info" : "個人情報", + "Mobile & desktop" : "モバイル & デスクトップ", "Unlimited" : "無制限", "Verifying" : "検証中", "Verifying …" : "検証中", diff --git a/lib/l10n/ru.js b/lib/l10n/ru.js index bcd9684547b..e94e6cde742 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -105,7 +105,9 @@ OC.L10N.register( "You are not allowed to share %s" : "Вам не разрешено делиться %s", "Sharing %s failed, because you can not share with yourself" : "Не удалось поделиться %s. Вы не можете поделиться с самим собой.", "Sharing %1$s failed, because the user %2$s does not exist" : "Не удалось предоставить общий доступ к «%1$s», пользователь %2$s не существует.", + "Sharing %1$s failed, because the user %2$s is not a member of any groups that %3$s is a member of" : "Не удалось предоставить доступ к «%1$s» , так как пользователь %2$s не состоит в какой-либо группе, в которой состоит %3$s", "Sharing %1$s failed, because this item is already shared with %2$s" : "Не удалось предоставить общий доступ к «%1$s» , пользователю %2$s такой доступ уже предоставлен.", + "Sharing %1$s failed, because this item is already shared with user %2$s" : "Не удалось предоставить доступ к «%1$s», так как этот ресурс уже доступен пользователю %2$s", "You need to provide a password to create a public link, only protected links are allowed" : "Вам нужно задать пароль для создания публичной ссылки. Разрешены только защищённые ссылки", "Sharing %s failed, because sharing with links is not allowed" : "Не удалось поделиться %s, открытие доступа по ссылке запрещено", "Not allowed to create a federated share with the same user" : "Не допускается создание федеративного общего ресурса с тем же пользователем", diff --git a/lib/l10n/ru.json b/lib/l10n/ru.json index 99a02f4d80b..699c3b2462d 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -103,7 +103,9 @@ "You are not allowed to share %s" : "Вам не разрешено делиться %s", "Sharing %s failed, because you can not share with yourself" : "Не удалось поделиться %s. Вы не можете поделиться с самим собой.", "Sharing %1$s failed, because the user %2$s does not exist" : "Не удалось предоставить общий доступ к «%1$s», пользователь %2$s не существует.", + "Sharing %1$s failed, because the user %2$s is not a member of any groups that %3$s is a member of" : "Не удалось предоставить доступ к «%1$s» , так как пользователь %2$s не состоит в какой-либо группе, в которой состоит %3$s", "Sharing %1$s failed, because this item is already shared with %2$s" : "Не удалось предоставить общий доступ к «%1$s» , пользователю %2$s такой доступ уже предоставлен.", + "Sharing %1$s failed, because this item is already shared with user %2$s" : "Не удалось предоставить доступ к «%1$s», так как этот ресурс уже доступен пользователю %2$s", "You need to provide a password to create a public link, only protected links are allowed" : "Вам нужно задать пароль для создания публичной ссылки. Разрешены только защищённые ссылки", "Sharing %s failed, because sharing with links is not allowed" : "Не удалось поделиться %s, открытие доступа по ссылке запрещено", "Not allowed to create a federated share with the same user" : "Не допускается создание федеративного общего ресурса с тем же пользователем", diff --git a/lib/l10n/zh_CN.js b/lib/l10n/zh_CN.js index 92ac030c83c..fd5d8c41b60 100644 --- a/lib/l10n/zh_CN.js +++ b/lib/l10n/zh_CN.js @@ -4,7 +4,9 @@ OC.L10N.register( "Cannot write into \"config\" directory!" : "无法写入 \"config\" 目录!ond", "This can usually be fixed by giving the webserver write access to the config directory" : "您可以设置 Web 服务器对 config 目录的写权限修复这个问题", "See %s" : "查看 %s", + "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "或者,如果希望保持 config.php 文件的只读权限,请将 \"config_is_read_only\" 设置为 true。", "This can usually be fixed by giving the webserver write access to the config directory. See %s" : "这个通常可以通过赋予写入权限到 config 目录来修复。查看:%s", + "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "或者,如果希望保持 config.php 文件的只读权限,请将 \"config_is_read_only\" 设置为 true。查看 %s", "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "应用 %$1s 的文件替换不正确. 请确认版本与当前服务器兼容.", "Sample configuration detected" : "示例配置检测", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "您似乎直接把 config.php 的样例文件直接复制使用. 这可能会破坏您的安装. 在对 config.php 进行修改之前请先阅读相关文档.", @@ -22,6 +24,8 @@ OC.L10N.register( "Following databases are supported: %s" : "支持以下数据库: %s", "The command line tool %s could not be found" : "命令行工具 %s 未找到", "The library %s is not available." : "库文件 %s 不可用", + "Library %1$s with a version higher than %2$s is required - available version %3$s." : "库版本 %1$s 高于需要的版本 %2$s - 可用版本 %3$s。", + "Library %1$s with a version lower than %2$s is required - available version %3$s." : "库版本 %1$s 低于需要的版本 %2$s - 可用版本 %3$s。", "Following platforms are supported: %s" : "支持以下平台:%s", "Server version %s or higher is required." : "需要服务器版本 %s 或更高版本。", "Server version %s or lower is required." : "需要服务器版本 %s 或更低版本。", @@ -72,6 +76,7 @@ OC.L10N.register( "Basic settings" : "基本设置", "Sharing" : "共享", "Security" : "安全", + "Groupware" : "组件", "Additional settings" : "其他设置", "Personal info" : "个人信息", "Mobile & desktop" : "移动 & 桌面", @@ -99,6 +104,7 @@ OC.L10N.register( "Sharing %s failed, because the file does not exist" : "共享 %s 失败, 因为文件不存在.", "You are not allowed to share %s" : "您无权共享 %s", "Sharing %s failed, because you can not share with yourself" : "共享 %s 失败, 因为您不能共享给自己", + "Sharing %1$s failed, because the user %2$s does not exist" : "共享 %1$s 失败,因为 %2$s 用户不存在", "You need to provide a password to create a public link, only protected links are allowed" : "您需要提供密码以创建公开链接,因为只允许创建受保护的链接。", "Sharing %s failed, because sharing with links is not allowed" : "共享 %s 失败, 因为不允许使用链接共享", "Not allowed to create a federated share with the same user" : "不允许创建对相同用户的联合共享", @@ -173,7 +179,7 @@ OC.L10N.register( "Could not create user" : "无法创建用户", "User disabled" : "用户已禁用", "Login canceled by app" : "已通过应用取消登录", - "a safe home for all your data" : "给您所有的数据一个安全的家", + "a safe home for all your data" : "给你所有数据一个安全的家", "File is currently busy, please try again later" : "文件当前正忙,请稍后再试", "Can't read file" : "无法读取文件", "Application is not enabled" : "应用程序未启用", diff --git a/lib/l10n/zh_CN.json b/lib/l10n/zh_CN.json index ade0d2f5823..7fe1e5af0ec 100644 --- a/lib/l10n/zh_CN.json +++ b/lib/l10n/zh_CN.json @@ -2,7 +2,9 @@ "Cannot write into \"config\" directory!" : "无法写入 \"config\" 目录!ond", "This can usually be fixed by giving the webserver write access to the config directory" : "您可以设置 Web 服务器对 config 目录的写权限修复这个问题", "See %s" : "查看 %s", + "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "或者,如果希望保持 config.php 文件的只读权限,请将 \"config_is_read_only\" 设置为 true。", "This can usually be fixed by giving the webserver write access to the config directory. See %s" : "这个通常可以通过赋予写入权限到 config 目录来修复。查看:%s", + "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "或者,如果希望保持 config.php 文件的只读权限,请将 \"config_is_read_only\" 设置为 true。查看 %s", "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "应用 %$1s 的文件替换不正确. 请确认版本与当前服务器兼容.", "Sample configuration detected" : "示例配置检测", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "您似乎直接把 config.php 的样例文件直接复制使用. 这可能会破坏您的安装. 在对 config.php 进行修改之前请先阅读相关文档.", @@ -20,6 +22,8 @@ "Following databases are supported: %s" : "支持以下数据库: %s", "The command line tool %s could not be found" : "命令行工具 %s 未找到", "The library %s is not available." : "库文件 %s 不可用", + "Library %1$s with a version higher than %2$s is required - available version %3$s." : "库版本 %1$s 高于需要的版本 %2$s - 可用版本 %3$s。", + "Library %1$s with a version lower than %2$s is required - available version %3$s." : "库版本 %1$s 低于需要的版本 %2$s - 可用版本 %3$s。", "Following platforms are supported: %s" : "支持以下平台:%s", "Server version %s or higher is required." : "需要服务器版本 %s 或更高版本。", "Server version %s or lower is required." : "需要服务器版本 %s 或更低版本。", @@ -70,6 +74,7 @@ "Basic settings" : "基本设置", "Sharing" : "共享", "Security" : "安全", + "Groupware" : "组件", "Additional settings" : "其他设置", "Personal info" : "个人信息", "Mobile & desktop" : "移动 & 桌面", @@ -97,6 +102,7 @@ "Sharing %s failed, because the file does not exist" : "共享 %s 失败, 因为文件不存在.", "You are not allowed to share %s" : "您无权共享 %s", "Sharing %s failed, because you can not share with yourself" : "共享 %s 失败, 因为您不能共享给自己", + "Sharing %1$s failed, because the user %2$s does not exist" : "共享 %1$s 失败,因为 %2$s 用户不存在", "You need to provide a password to create a public link, only protected links are allowed" : "您需要提供密码以创建公开链接,因为只允许创建受保护的链接。", "Sharing %s failed, because sharing with links is not allowed" : "共享 %s 失败, 因为不允许使用链接共享", "Not allowed to create a federated share with the same user" : "不允许创建对相同用户的联合共享", @@ -171,7 +177,7 @@ "Could not create user" : "无法创建用户", "User disabled" : "用户已禁用", "Login canceled by app" : "已通过应用取消登录", - "a safe home for all your data" : "给您所有的数据一个安全的家", + "a safe home for all your data" : "给你所有数据一个安全的家", "File is currently busy, please try again later" : "文件当前正忙,请稍后再试", "Can't read file" : "无法读取文件", "Application is not enabled" : "应用程序未启用", diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index cf017c73960..947dd11b4f4 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -37,6 +37,7 @@ namespace OC\Files\Cache; +use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use OCP\DB\QueryBuilder\IQueryBuilder; use Doctrine\DBAL\Driver\Statement; use OCP\Files\Cache\ICache; @@ -239,6 +240,8 @@ class Cache implements ICache { * * @return int file id * @throws \RuntimeException + * + * @suppress SqlInjectionChecker */ public function insert($file, array $data) { // normalize file @@ -269,12 +272,20 @@ class Cache implements ICache { return trim($item, "`"); }, $queryParts); $values = array_combine($queryParts, $params); - if (\OC::$server->getDatabaseConnection()->insertIfNotExist('*PREFIX*filecache', $values, [ - 'storage', - 'path_hash', - ]) - ) { - return (int)$this->connection->lastInsertId('*PREFIX*filecache'); + + try { + $builder = $this->connection->getQueryBuilder(); + $builder->insert('filecache'); + + foreach ($values as $column => $value) { + $builder->setValue($column, $builder->createNamedParameter($value)); + } + + if ($builder->execute()) { + return (int)$this->connection->lastInsertId('*PREFIX*filecache'); + } + } catch(UniqueConstraintViolationException $e) { + // entry exists already } // The file was created in the mean time @@ -282,7 +293,7 @@ class Cache implements ICache { $this->update($id, $data); return $id; } else { - throw new \RuntimeException('File entry could not be inserted with insertIfNotExist() but could also not be selected with getId() in order to perform an update. Please try again.'); + throw new \RuntimeException('File entry could not be inserted but could also not be selected with getId() in order to perform an update. Please try again.'); } } diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php index 9de1098a466..f5d92675076 100644 --- a/lib/private/Lock/DBLockingProvider.php +++ b/lib/private/Lock/DBLockingProvider.php @@ -26,6 +26,7 @@ namespace OC\Lock; +use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use OC\DB\QueryBuilder\Literal; use OCP\AppFramework\Utility\ITimeFactory; use OCP\DB\QueryBuilder\IQueryBuilder; @@ -116,7 +117,17 @@ class DBLockingProvider extends AbstractLockingProvider { protected function initLockField($path, $lock = 0) { $expire = $this->getExpireTime(); - return $this->connection->insertIfNotExist('*PREFIX*file_locks', ['key' => $path, 'lock' => $lock, 'ttl' => $expire], ['key']); + + try { + $builder = $this->connection->getQueryBuilder(); + return $builder->insert('file_locks') + ->setValue('key', $builder->createNamedParameter($path)) + ->setValue('lock', $builder->createNamedParameter($lock)) + ->setValue('ttl', $builder->createNamedParameter($expire)) + ->execute(); + } catch(UniqueConstraintViolationException $e) { + return 0; + } } /** |