From 11ec813155623124638aa3a74b47885d10f51d22 Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 22 Aug 2016 14:50:34 -0300 Subject: [PATCH 1/3] Decode HTML entities Just to allow us to use HTML in the about section. --- bl-plugins/about/plugin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bl-plugins/about/plugin.php b/bl-plugins/about/plugin.php index 7a1e5579..bb3eccb1 100644 --- a/bl-plugins/about/plugin.php +++ b/bl-plugins/about/plugin.php @@ -18,7 +18,6 @@ class pluginAbout extends Plugin { $html .= ''; $html .= ''; $html .= ''; - $html .= '
'; $html .= ''; $html .= ''; @@ -32,10 +31,10 @@ class pluginAbout extends Plugin { $html = '
'; $html .= '

'.$this->getDbField('label').'

'; $html .= '
'; - $html .= nl2br($this->getDbField('text')); + $html .= html_entity_decode(nl2br($this->getDbField('text'))); $html .= '
'; $html .= '
'; return $html; } -} \ No newline at end of file +} From acb32518ca5da87264296d4ebb89c7847662a515 Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 22 Aug 2016 15:05:35 -0300 Subject: [PATCH 2/3] Allow SVG upload Just to make #222 able to merge again --- bl-kernel/admin/themes/default/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bl-kernel/admin/themes/default/init.php b/bl-kernel/admin/themes/default/init.php index bc67c0d9..75b46d9c 100644 --- a/bl-kernel/admin/themes/default/init.php +++ b/bl-kernel/admin/themes/default/init.php @@ -356,7 +356,7 @@ $(document).ready(function() { { type: "json", action: HTML_PATH_ADMIN_ROOT+"ajax/uploader", - allow : "*.(jpg|jpeg|gif|png)", + allow : "*.(jpg|jpeg|gif|png|svg)", params: {"type":"profilePicture", "username":"'.$username.'"}, loadstart: function() { @@ -391,4 +391,4 @@ $(document).ready(function() { echo $html.$script; } -} \ No newline at end of file +} From b6b72984d24409d5c53b92d3199f9dde7da7045f Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 22 Aug 2016 15:12:46 -0300 Subject: [PATCH 3/3] Create SVG thumbnails Just to make #222 able to merge again --- bl-kernel/ajax/uploader.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bl-kernel/ajax/uploader.php b/bl-kernel/ajax/uploader.php index 74206383..281dddaf 100644 --- a/bl-kernel/ajax/uploader.php +++ b/bl-kernel/ajax/uploader.php @@ -47,11 +47,20 @@ if($type=='profilePicture') else { // Generate the thumbnail $Image = new Image(); - $Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop'); - $Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, THUMBNAILS_QUALITY, true); + + //Handling all other formats than svg + if (strcasecmp($fileExtension, 'svg') != 0) { + $Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop'); + $Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, THUMBNAILS_QUALITY, true); + } // Move the original to the upload folder. rename(PATH_TMP.'original'.'.'.$fileExtension, PATH_UPLOADS.$tmpName); + + //If it is a svg file, just save a copy in thumbnail-folder + if (strcasecmp($fileExtension, 'svg') == 0) { + symlink(PATH_UPLOADS.$tmpName, PATH_UPLOADS_THUMBNAILS.$tmpName); + } } // Remove the Bludit temporary file.