From: ArthurHoaro Date: Mon, 31 Aug 2015 10:27:56 +0000 (+0200) Subject: Add HTTPS support for title extracting feature X-Git-Tag: v0.5.2~1^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=26c503460cd2b50c2c122dba73d62e09ee04b9c8;p=github%2Fshaarli%2FShaarli.git Add HTTPS support for title extracting feature --- diff --git a/index.php b/index.php index ba70b29c..9c3f7c1b 100755 --- a/index.php +++ b/index.php @@ -1497,8 +1497,8 @@ function renderPage() $description = (empty($_GET['description']) ? '' : $_GET['description']); $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); - // If this is an HTTP link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) - if (empty($title) && $url->getScheme() == 'http') { + // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) + if (empty($title) && strpos($url->getScheme(), 'http') !== false) { list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive. // FIXME: Decode charset according to specified in either 1) HTTP response headers or 2) in html if (strpos($status,'200 OK')!==false) {