From 616aa3300a216e4e4d0edaba09e020742666fb34 Mon Sep 17 00:00:00 2001 From: HungryFeline Date: Tue, 2 Jul 2013 04:44:27 +0200 Subject: [PATCH 1/2] Don't check the certificate when transloading This allows the download of images via https even if the cert is self-signed. --- core/util.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/util.inc.php b/core/util.inc.php index 75e28ccd..42d285af 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -805,6 +805,7 @@ function transload($url, $mfile) { curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_USERAGENT, "Shimmie-".VERSION); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_exec($ch); curl_close($ch); @@ -816,7 +817,7 @@ function transload($url, $mfile) { if($config->get_string("transload_engine") == "wget") { $s_url = escapeshellarg($url); $s_mfile = escapeshellarg($mfile); - system("wget $s_url --output-document=$s_mfile"); + system("wget --no-check-certificate $s_url --output-document=$s_mfile"); return file_exists($mfile); } From 65fcbcb9ba46ab247bcc32469021f55e8d1f8361 Mon Sep 17 00:00:00 2001 From: HungryFeline Date: Tue, 2 Jul 2013 06:46:54 +0200 Subject: [PATCH 2/2] Actually set the cookie prefix When COOKIE_PREFIX was not shm (the default) the script tried to read cookies prefixed with the new prefix but the script was setting the old default prefix from before the constants were implemented. --- core/util.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/util.inc.php b/core/util.inc.php index 42d285af..6dd9dbc3 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -713,7 +713,7 @@ function get_prefixed_cookie(/*string*/ $name) { */ function set_prefixed_cookie($name, $value, $time, $path) { global $config; - $full_name = $config->get_string('cookie_prefix','shm')."_".$name; + $full_name = COOKIE_PREFIX."_".$name; setcookie($full_name, $value, $time, $path); }