From fccd1c28c8341ef2f1a8f16dfc431ecf79c73005 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 21 Jul 2020 12:24:16 +0200 Subject: [PATCH] Remove imagePath option from StyleAddForm --- .../install/files/acp/templates/styleAdd.tpl | 16 ---------------- .../files/lib/acp/form/StyleAddForm.class.php | 18 ------------------ .../files/lib/acp/form/StyleEditForm.class.php | 2 -- 3 files changed, 36 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/styleAdd.tpl b/wcfsetup/install/files/acp/templates/styleAdd.tpl index 05c5156c1d..803ef8eb9c 100644 --- a/wcfsetup/install/files/acp/templates/styleAdd.tpl +++ b/wcfsetup/install/files/acp/templates/styleAdd.tpl @@ -297,22 +297,6 @@ {/if} - -
-
- - {if $errorField == 'imagePath'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.style.imagePath.error.{$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.style.imagePath.description{/lang} -
- {event name='fileFields'} diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index 89afd3d3f1..4d6e140d28 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -107,12 +107,6 @@ class StyleAddForm extends AbstractForm { */ public $globals = []; - /** - * image path - * @var string - */ - public $imagePath = 'images/'; - /** * tainted style * @var boolean @@ -327,7 +321,6 @@ class StyleAddForm extends AbstractForm { if (isset($_POST['authorName'])) $this->authorName = StringUtil::trim($_POST['authorName']); if (isset($_POST['authorURL'])) $this->authorURL = StringUtil::trim($_POST['authorURL']); if (isset($_POST['copyright'])) $this->copyright = StringUtil::trim($_POST['copyright']); - if (isset($_POST['imagePath'])) $this->imagePath = StringUtil::trim($_POST['imagePath']); if (isset($_POST['license'])) $this->license = StringUtil::trim($_POST['license']); if (isset($_POST['packageName'])) $this->packageName = StringUtil::trim($_POST['packageName']); if (isset($_POST['styleDate'])) $this->styleDate = StringUtil::trim($_POST['styleDate']); @@ -405,14 +398,6 @@ class StyleAddForm extends AbstractForm { } } - // ensure image path is below WCF_DIR/images/ - if ($this->imagePath) { - $relativePath = FileUtil::unifyDirSeparator(FileUtil::getRelativePath(WCF_DIR.'images/', WCF_DIR.$this->imagePath)); - if (strpos($relativePath, '../') !== false) { - throw new UserInputException('imagePath', 'invalid'); - } - } - if (!empty($this->variables['overrideScss'])) { $this->parseOverrides(); } @@ -725,7 +710,6 @@ class StyleAddForm extends AbstractForm { 'styleDescription' => '', 'styleVersion' => $this->styleVersion, 'styleDate' => $this->styleDate, - 'imagePath' => $this->imagePath, 'copyright' => $this->copyright, 'license' => $this->license, 'authorName' => $this->authorName, @@ -754,7 +738,6 @@ class StyleAddForm extends AbstractForm { $this->authorName = $this->authorURL = $this->copyright = $this->packageName = ''; $this->license = $this->styleDate = $this->styleDescription = $this->styleName = $this->styleVersion = ''; $this->setDefaultValues(); - $this->imagePath = 'images/'; $this->isTainted = true; $this->templateGroupID = 0; $this->rebuildUploadFields(); @@ -786,7 +769,6 @@ class StyleAddForm extends AbstractForm { 'colorCategories' => $this->colorCategories, 'colors' => $this->colors, 'copyright' => $this->copyright, - 'imagePath' => $this->imagePath, 'isTainted' => $this->isTainted, 'license' => $this->license, 'packageName' => $this->packageName, diff --git a/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php index f0f927bc18..aba1ec5ebe 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php @@ -144,7 +144,6 @@ class StyleEditForm extends StyleAddForm { $this->authorName = $this->style->authorName; $this->authorURL = $this->style->authorURL; $this->copyright = $this->style->copyright; - $this->imagePath = $this->style->imagePath; $this->isTainted = $this->style->isTainted; $this->license = $this->style->license; $this->packageName = $this->style->packageName; @@ -191,7 +190,6 @@ class StyleEditForm extends StyleAddForm { 'templateGroupID' => $this->templateGroupID, 'styleVersion' => $this->styleVersion, 'styleDate' => $this->styleDate, - 'imagePath' => $this->imagePath, 'copyright' => $this->copyright, 'packageName' => $this->packageName, 'license' => $this->license, -- 2.20.1