{"record":{"id":"b321eae2fc562b48","repo":"nextcloud/all-in-one","slug":"the-timezone-must-not-be-empty","errorCode":null,"errorMessage":"The timezone must not be empty!","messagePattern":"The timezone must not be empty!","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"warning","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":1022,"sourceCode":"    }\n\n    public function getAdditionalBackupDirectoriesArray() : array {\n        $additionalBackupDirectories = $this->getAdditionalBackupDirectoriesString();\n        $additionalBackupDirectoriesArray = explode(\"\\n\", $additionalBackupDirectories);\n        $additionalBackupDirectoriesArray = array_unique($additionalBackupDirectoriesArray, SORT_REGULAR);\n        return $additionalBackupDirectoriesArray;\n    }\n\n    public function isDailyBackupRunning() : bool {\n        return file_exists(DataConst::GetDailyBackupBlockFile());\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    private function validateTimezone(string $timezone) : void {\n        if ($timezone === \"\") {\n            throw new InvalidSettingConfigurationException(\"The timezone must not be empty!\");\n        }\n\n        if (!preg_match(\"#^[a-zA-Z0-9_\\-\\/\\+]+$#\", $timezone)) {\n            throw new InvalidSettingConfigurationException(\"The entered timezone does not seem to be a valid timezone!\");\n        }\n    }\n\n    /**\n     * Provide an extra method since our `timezone` attribute setter prevents setting an empty timezone.\n     */\n    public function deleteTimezone() : void {\n        $this->set('timezone', '');\n    }\n\n    public function shouldDomainValidationBeSkipped(bool $skipDomainValidation) : bool {\n        if ($skipDomainValidation || getenv('SKIP_DOMAIN_VALIDATION') === 'true') {\n            return true;\n        }","sourceCodeStart":1004,"sourceCodeEnd":1040,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L1004-L1040","documentation":"Thrown by validateTimezone when the timezone string is empty. The validator is called from the timezone attribute setter used when the web form posts a 'timezone' value; an empty string would otherwise clear the setting, so deletion has its own dedicated path (deleteTimezone via the delete_timezone form key).","triggerScenarios":"POSTing the web configuration form with 'timezone' present but '' instead of using the separate delete_timezone action.","commonSituations":"Automation that includes every form key with empty defaults; a timezone picker that submits an empty value when the browser blocks its assets.","solutions":["Send a real IANA timezone identifier such as 'Europe/Berlin' in the timezone field.","To unset the timezone, POST 'delete_timezone' instead of an empty timezone value.","Omit the timezone key entirely when it should not change."],"exampleFix":"// before\ncurl -d 'timezone=' https://host/api/webconfig\n\n// after\ncurl -d 'timezone=Europe/Berlin' https://host/api/webconfig\n// or to remove it:\ncurl -d 'delete_timezone=1' https://host/api/webconfig","handlingStrategy":"validation","validationCode":"if ($timezone === '') {\n    // use delete_timezone action instead of posting an empty value\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a curated list of IANA identifiers in the picker so empty is unrepresentable.","Separate 'unset' (delete key) from 'set' (value key) in automation."],"tags":["php","nextcloud-aio","input-validation","timezone","configuration"],"backgroundTag":"required-field-empty","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}