diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-08-31 12:27:56 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-08-31 12:30:59 +0200 |
commit | 26c503460cd2b50c2c122dba73d62e09ee04b9c8 (patch) | |
tree | 3a094cebb88ef744120426b06b71bd7585e46359 | |
parent | 9e1724f1922bf9e38299eecedfce2dcdbd416749 (diff) | |
download | Shaarli-26c503460cd2b50c2c122dba73d62e09ee04b9c8.tar.gz Shaarli-26c503460cd2b50c2c122dba73d62e09ee04b9c8.tar.zst Shaarli-26c503460cd2b50c2c122dba73d62e09ee04b9c8.zip |
Add HTTPS support for title extracting feature
-rwxr-xr-x | index.php | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1497,8 +1497,8 @@ function renderPage() | |||
1497 | $description = (empty($_GET['description']) ? '' : $_GET['description']); | 1497 | $description = (empty($_GET['description']) ? '' : $_GET['description']); |
1498 | $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); | 1498 | $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); |
1499 | $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); | 1499 | $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); |
1500 | // 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.) | 1500 | // 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.) |
1501 | if (empty($title) && $url->getScheme() == 'http') { | 1501 | if (empty($title) && strpos($url->getScheme(), 'http') !== false) { |
1502 | list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive. | 1502 | list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive. |
1503 | // FIXME: Decode charset according to specified in either 1) HTTP response headers or 2) <head> in html | 1503 | // FIXME: Decode charset according to specified in either 1) HTTP response headers or 2) <head> in html |
1504 | if (strpos($status,'200 OK')!==false) { | 1504 | if (strpos($status,'200 OK')!==false) { |