Merge branch 'master'
authorjoshuaruesweg <ruesweg@woltlab.com>
Tue, 4 Aug 2020 13:06:02 +0000 (15:06 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Tue, 4 Aug 2020 13:06:02 +0000 (15:06 +0200)
1  2 
wcfsetup/install/files/acp/templates/styleAdd.tpl
wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php
wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 25937ee8507dcafa90468aec707135694a386ba6,d29a6a73279ca7aec4d417436d4750ab753e4e29..5102f514a478561916df9a31a8df8086c119d0f5
@@@ -9,9 -10,13 +10,14 @@@ use wcf\form\AbstractForm
  use wcf\system\event\EventHandler;
  use wcf\system\exception\SystemException;
  use wcf\system\exception\UserInputException;
+ use wcf\system\file\upload\UploadField;
+ use wcf\system\file\upload\UploadHandler;
+ use wcf\system\image\ImageHandler;
  use wcf\system\language\I18nHandler;
  use wcf\system\Regex;
 +use wcf\system\style\StyleCompiler;
+ use wcf\system\style\exception\FontDownloadFailed;
+ use wcf\system\style\FontManager;
  use wcf\system\WCF;
  use wcf\util\ArrayUtil;
  use wcf\util\DateUtil;
@@@ -357,28 -447,13 +448,32 @@@ class StyleAddForm extends AbstractFor
                        $this->parseOverrides();
                }
                
 +              $this->validateIndividualScss();
 +              
                $this->validateApiVersion();
+               
+               $this->validateUploads();
+               
+               $this->downloadGoogleFont();
        }
        
 +      /**
 +       * Validates the individual scss.
 +       * @throws      UserInputException
 +       * @since       5.3
 +       */
 +      public function validateIndividualScss() {
 +              $variables = array_merge(StyleCompiler::getDefaultVariables(), $this->variables);
 +              
 +              $result = StyleCompiler::getInstance()->testStyle($this->apiVersion, $this->imagePath, $variables);
 +              
 +              if ($result !== true) {
 +                      throw new UserInputException('individualScss', [
 +                              'message' => $result,
 +                      ]);
 +              }
 +      }
 +      
        /**
         * Disallow the use of `com.woltlab.*` for package names to avoid accidental collisions.
         * 
index e855f5bdcc24d5789d60fa19686d4364cbb24201,8e262b0afc6b8da7f519261131d8f4ce1c9fa026..1e99f44160bef66464c261ea42b6b9e30e1bc4a7
@@@ -5,10 -5,9 +5,12 @@@ use wcf\data\style\StyleAction
  use wcf\data\user\cover\photo\UserCoverPhoto;
  use wcf\form\AbstractForm;
  use wcf\system\exception\IllegalLinkException;
 +use wcf\system\exception\SystemException;
 +use wcf\system\exception\UserInputException;
+ use wcf\system\file\upload\UploadFile;
+ use wcf\system\file\upload\UploadHandler;
  use wcf\system\language\I18nHandler;
 +use wcf\system\style\StyleCompiler;
  use wcf\system\WCF;
  
  /**
Simple merge
Simple merge