throw new UserInputException('templateGroupName');
}
- if (!preg_match('/^[a-z0-9_\-]+\/$/i', $this->templateGroupName)) {
- throw new UserInputException('templateGroupName', 'notValid');
- }
-
$sql = "SELECT COUNT(*) AS count
FROM wcf".WCF_N."_template_group
WHERE templateGroupName = ?";
throw new UserInputException('templateGroupFolderName');
}
- if ($this->templateGroupFolderName == '/') {
- throw new UserInputException('templateGroupFolderName', 'notUnique');
+ if (!preg_match('/^[a-z0-9_\- ]+\/$/i', $this->templateGroupFolderName)) {
+ throw new UserInputException('templateGroupFolderName', 'notValid');
}
$sql = "SELECT COUNT(*) AS count
* Deletes the folder of this template group.
*/
public function deleteFolder() {
- DirectoryUtil::getInstance(WCF_DIR . 'templates/' . $this->templateGroupFolderName)->removeAll();
+ if (file_exists(WCF_DIR . 'templates/' . $this->templateGroupFolderName)) {
+ DirectoryUtil::getInstance(WCF_DIR . 'templates/' . $this->templateGroupFolderName)->removeAll();
+ }
}
/**