{"record":{"id":"9973de1cf74eb5d0","repo":"nextcloud/all-in-one","slug":"the-entered-timezone-does-not-seem-to-be-a-valid-t","errorCode":null,"errorMessage":"The entered timezone does not seem to be a valid timezone!","messagePattern":"The entered timezone does not seem to be a valid timezone!","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"warning","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":1026,"sourceCode":"        $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        }\n        return false;\n    }\n\n    public function getApacheAdditionalNetwork() : string {","sourceCodeStart":1008,"sourceCodeEnd":1044,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L1008-L1044","documentation":"Thrown by validateTimezone when the string does not match ^[a-zA-Z0-9_-/+]+$. This is a loose syntactic whitelist for IANA identifiers (e.g. 'America/Argentina/Buenos_Aires', 'Etc/GMT+5'), not a check that the timezone exists; unusual but real identifiers with other characters would also be rejected.","triggerScenarios":"Submitting a timezone containing spaces, commas, parentheses or dots: 'GMT+02:00', 'UTC+2', '(UTC+01:00) Brussels', 'America/Indiana/Indianapolis.' with trailing punctuation.","commonSituations":"See trigger scenarios.","solutions":["Use a canonical IANA zone name; list candidates with PHP's DateTimeZone::listIdentifiers().","For UTC use 'UTC'; for fixed offsets use an 'Etc/GMT+5'-style identifier (note the inverted sign), never 'UTC+2'.","Trim whitespace and drop any Windows/CLR-style display formatting before submitting."],"exampleFix":"// before\n$timezone = 'GMT+02:00';\n\n// after\n$timezone = 'Europe/Berlin';","handlingStrategy":"validation","validationCode":"if (!preg_match('#^[a-zA-Z0-9_\\\\-/\\\\+]+$#', $timezone) || !in_array($timezone, DateTimeZone::listIdentifiers(), true)) {\n    // reject before assigning configurationManager->timezone\n}","typeGuard":"function isValidIanaTimezone(string $tz): bool\n{\n    return in_array($tz, DateTimeZone::listIdentifiers(DateTimeZone::ALL), true);\n}","tryCatchPattern":null,"preventionTips":["Populate the form from DateTimeZone::listIdentifiers().","Never paste display strings like '(UTC+01:00) Brussels'."],"tags":["php","nextcloud-aio","input-validation","timezone","configuration"],"backgroundTag":"invalid-timezone","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}