From 8e11a7b895ec5ba606df151ccded34b76eb83657 Mon Sep 17 00:00:00 2001
From: Vojtech Kral <vojtech@kral.hk>
Date: Mon, 16 Sep 2019 17:51:31 +0200
Subject: [PATCH 1/2] PresetUpdater: Fix: Sanitize downloadedsemver, fix #2927
 Use HTTPS for the slicer app version url

---
 src/slic3r/GUI/AppConfig.cpp       |  2 +-
 src/slic3r/Utils/PresetUpdater.cpp | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/slic3r/GUI/AppConfig.cpp b/src/slic3r/GUI/AppConfig.cpp
index 96213447c..5a165e8ae 100644
--- a/src/slic3r/GUI/AppConfig.cpp
+++ b/src/slic3r/GUI/AppConfig.cpp
@@ -26,7 +26,7 @@ namespace Slic3r {
 
 static const std::string VENDOR_PREFIX = "vendor:";
 static const std::string MODEL_PREFIX = "model:";
-static const std::string VERSION_CHECK_URL = "http://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/PrusaSlicer.version";
+static const std::string VERSION_CHECK_URL = "https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/PrusaSlicer.version";
 
 void AppConfig::reset()
 {
diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp
index d55063c7b..5723afca2 100644
--- a/src/slic3r/Utils/PresetUpdater.cpp
+++ b/src/slic3r/Utils/PresetUpdater.cpp
@@ -245,6 +245,16 @@ void PresetUpdater::priv::sync_version() const
 		})
 		.on_complete([&](std::string body, unsigned /* http_status */) {
 			boost::trim(body);
+			const auto nl_pos = body.find_first_of("\n\r");
+			if (nl_pos != std::string::npos) {
+				body.resize(nl_pos);
+			}
+
+			if (! Semver::parse(body)) {
+				BOOST_LOG_TRIVIAL(warning) << boost::format("Received invalid contents from `%1%`: Not a correct semver: `%2%`") % SLIC3R_APP_NAME % body;
+				return;
+			}
+
 			BOOST_LOG_TRIVIAL(info) << boost::format("Got %1% online version: `%2%`. Sending to GUI thread...") % SLIC3R_APP_NAME % body;
 
 			wxCommandEvent* evt = new wxCommandEvent(EVT_SLIC3R_VERSION_ONLINE);

From a93e63e296e7041ee2ec8f16762623551bbd9025 Mon Sep 17 00:00:00 2001
From: Enrico Turri <enricoturri@seznam.cz>
Date: Tue, 17 Sep 2019 12:50:54 +0200
Subject: [PATCH 2/2] Fixed object shifted after saving to/reloading from .3mf
 and .zip.amf a multivolume object with printable parts moved by user

---
 src/slic3r/GUI/Plater.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp
index a19386950..c5aad48a9 100644
--- a/src/slic3r/GUI/Plater.cpp
+++ b/src/slic3r/GUI/Plater.cpp
@@ -2310,7 +2310,8 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
             }
 
             for (ModelObject* model_object : model.objects) {
-                model_object->center_around_origin(false);
+                if (!type_3mf && !type_zip_amf)
+                    model_object->center_around_origin(false);
                 model_object->ensure_on_bed();
             }