From 37c9ebf7c9ac160e470f32ec75a97a4c3dc729f4 Mon Sep 17 00:00:00 2001
From: Ghislain Loas <ghislo@sandbox.pergame.net>
Date: Thu, 26 Nov 2015 17:31:28 +0100
Subject: [PATCH] hotline #33756

---
 VERSIONS_HOTLINE/33756                                | 1 +
 library/Class/WebService/SIGB/AbstractRESTService.php | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 VERSIONS_HOTLINE/33756

diff --git a/VERSIONS_HOTLINE/33756 b/VERSIONS_HOTLINE/33756
new file mode 100644
index 00000000000..72f69bcff11
--- /dev/null
+++ b/VERSIONS_HOTLINE/33756
@@ -0,0 +1 @@
+ - ticket #33756 : Cosmogramme ne gère pas https avec Koha
\ No newline at end of file
diff --git a/library/Class/WebService/SIGB/AbstractRESTService.php b/library/Class/WebService/SIGB/AbstractRESTService.php
index 1303ebb6eba..6aa2c825958 100644
--- a/library/Class/WebService/SIGB/AbstractRESTService.php
+++ b/library/Class/WebService/SIGB/AbstractRESTService.php
@@ -37,7 +37,9 @@ abstract class Class_WebService_SIGB_AbstractRESTService extends Class_WebServic
    * @return Class_WebService_SIGB_AbstractRESTService
    */
   public function setServerRoot($server_root) {
-    $this->_server_root = 'http://' . str_replace('http://', '', $server_root);
+    $this->_server_root = (false === strpos('https:://', $server_root)
+                           ? 'http://' . str_replace('http://', '', $server_root)
+                           : $server_root);
     return $this;
   }
 
-- 
GitLab