summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2022-05-25 08:51:16 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-06-15 13:55:12 +0000
commitff16e0425dba1393af7fc7ed98a9447c5e14d09c (patch)
tree6ff88363f54ffcc82406ffd1521ba35097f4f341
parent52fc620ba147bac4443f07cd5bddf381443a02d0 (diff)
downloadnextcloud-server-ff16e0425dba1393af7fc7ed98a9447c5e14d09c.tar.gz
nextcloud-server-ff16e0425dba1393af7fc7ed98a9447c5e14d09c.zip
Make sure ResetTokenBackgroundJob doesn't execute if config is read-only
No need to try to delete the config key in config.php if we aren't allowed to. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
-rw-r--r--apps/updatenotification/lib/ResetTokenBackgroundJob.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/updatenotification/lib/ResetTokenBackgroundJob.php b/apps/updatenotification/lib/ResetTokenBackgroundJob.php
index 96a50c5ff7f..0d07c7301d9 100644
--- a/apps/updatenotification/lib/ResetTokenBackgroundJob.php
+++ b/apps/updatenotification/lib/ResetTokenBackgroundJob.php
@@ -59,7 +59,7 @@ class ResetTokenBackgroundJob extends TimedJob {
*/
protected function run($argument) {
// Delete old tokens after 2 days
- if ($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) {
+ if ($this->config->getSystemValueBool('config_is_read_only') === false && $this->timeFactory->getTime() - (int) $this->config->getAppValue('core', 'updater.secret.created', (string) $this->timeFactory->getTime()) >= 172800) {
$this->config->deleteSystemValue('updater.secret');
}
}