From: Tim Düsterhus Date: Mon, 6 Jun 2016 15:28:59 +0000 (+0200) Subject: Merge branch 'master' into next X-Git-Tag: 3.0.0_Beta_1~1512 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce7c3d483ea91b194d10f3ede89d268f12996254;p=GitHub%2FWoltLab%2FWCF.git Merge branch 'master' into next --- ce7c3d483ea91b194d10f3ede89d268f12996254 diff --cc wcfsetup/install/files/lib/data/style/StyleEditor.class.php index ca698d852e,7a07ab6082..e6b18c6745 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@@ -476,34 -451,37 +476,34 @@@ class StyleEditor extends DatabaseObjec } // save style - if ($style !== null) { - $style->update($styleData); - } - else { + if ($style === null) { $styleData['packageID'] = $packageID; $style = new StyleEditor(self::create($styleData)); - } - - // import preview image - if (!empty($data['image'])) { - $fileExtension = mb_substr($data['image'], mb_strrpos($data['image'], '.')); - $index = $tar->getIndexByFilename($data['image']); - if ($index !== false) { - $filename = WCF_DIR.'images/stylePreview-'.$style->styleID.$fileExtension; - $tar->extract($index, $filename); - FileUtil::makeWritable($filename); - - if (file_exists($filename)) { - try { - if (($imageData = getimagesize($filename)) !== false) { - switch ($imageData[2]) { - case IMAGETYPE_PNG: - case IMAGETYPE_JPEG: - case IMAGETYPE_JPG: - case IMAGETYPE_GIF: - $style->update(array('image' => 'stylePreview-'.$style->styleID.$fileExtension)); + + // import preview image + if (!empty($data['image'])) { + $fileExtension = mb_substr($data['image'], mb_strrpos($data['image'], '.')); + $index = $tar->getIndexByFilename($data['image']); + if ($index !== false) { + $filename = WCF_DIR.'images/stylePreview-'.$style->styleID.$fileExtension; + $tar->extract($index, $filename); + FileUtil::makeWritable($filename); + + if (file_exists($filename)) { + try { + if (($imageData = getimagesize($filename)) !== false) { + switch ($imageData[2]) { - case IMG_PNG: - case IMG_JPEG: - case IMG_JPG: - case IMG_GIF: ++ case IMAGETYPE_PNG: ++ case IMAGETYPE_JPEG: ++ case IMAGETYPE_JPG: ++ case IMAGETYPE_GIF: + $style->update(['image' => 'stylePreview-'.$style->styleID.$fileExtension]); + } } } - } - catch (SystemException $e) { - // broken image + catch (SystemException $e) { + // broken image + } } } } diff --cc wcfsetup/setup/db/install.sql index 2f02131c9c,162c5bd866..1a99576fed --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@@ -2126,13 -1876,9 +2126,11 @@@ INSERT INTO wcf1_template_group (parent -- media providers -- Videos -- Youtube - INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('YouTube', 'https?://(?:.+?\\.)?youtu(?:\\.be/|be\\.com/(?:#/)?watch\\?(?:.*?&)?v=)(?P[a-zA-Z0-9_-]+)(?:(?:\\?|&)t=(?P\\d+)$)?', ''); + INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('YouTube', 'https?://(?:.+?\\.)?youtu(?:\\.be/|be\\.com/(?:#/)?watch\\?(?:.*?&)?v=)(?P[a-zA-Z0-9_-]+)(?:(?:\\?|&)t=(?P\\d+)$)?', '
'); + -- Youtube playlist + INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('YouTube Playlist', 'https?://(?:.+?\\.)?youtu(?:\\.be/|be\\.com/)playlist\\?(?:.*?&)?list=(?P[a-zA-Z0-9_-]+)', '
'); -- Vimeo INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('Vimeo', 'https?://vimeo\\.com/(?P\\d+)', ''); - -- MyVideo - INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('MyVideo', 'http://(?:www\\.)?myvideo\\.de/watch/(?P\\d+)', ''); -- Clipfish INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('Clipfish', 'http://(?:www\\.)?clipfish\\.de/(?:.*?/)?video/(?P\\d+)/', '
'); -- Veoh