• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónde488170bed4231ee9b6864894998aa475d36979 (tree)
Tiempo2017-10-21 01:27:13
Autorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2442 showrss plugin - Support HTTPS RSS feeds

Cambiar Resumen

Diferencia incremental

--- a/lib/proxy.php
+++ b/lib/proxy.php
@@ -1,7 +1,7 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone
33 // proxy.php
4-// Copyright: 2003-2016 PukiWiki Development Team
4+// Copyright: 2003-2017 PukiWiki Development Team
55 // License: GPL v2 or (at your option) any later version
66 //
77 // HTTP-Proxy related functions
@@ -35,7 +35,6 @@ function pkwk_http_request($url, $method = 'GET', $headers = '', $post = array()
3535 {
3636 global $use_proxy, $no_proxy, $proxy_host, $proxy_port;
3737 global $need_proxy_auth, $proxy_auth_user, $proxy_auth_pass;
38-
3938 $rc = array();
4039 $arr = parse_url($url);
4140
@@ -44,7 +43,13 @@ function pkwk_http_request($url, $method = 'GET', $headers = '', $post = array()
4443 // query
4544 $arr['query'] = isset($arr['query']) ? '?' . $arr['query'] : '';
4645 // port
47- $arr['port'] = isset($arr['port']) ? $arr['port'] : 80;
46+ if (!isset($arr['port'])) {
47+ if ($arr['scheme'] === 'https') {
48+ $arr['port'] = 443;
49+ } else {
50+ $arr['port'] = 80;
51+ }
52+ }
4853
4954 $url_base = $arr['scheme'] . '://' . $arr['host'] . ':' . $arr['port'];
5055 $url_path = isset($arr['path']) ? $arr['path'] : '/';
@@ -90,8 +95,12 @@ function pkwk_http_request($url, $method = 'GET', $headers = '', $post = array()
9095
9196 $errno = 0;
9297 $errstr = '';
98+ $ssl_prefix = '';
99+ if ($arr['scheme'] === 'https') {
100+ $ssl_prefix = 'ssl://';
101+ }
93102 $fp = fsockopen(
94- $via_proxy ? $proxy_host : $arr['host'],
103+ $ssl_prefix . ($via_proxy ? $proxy_host : $arr['host']),
95104 $via_proxy ? $proxy_port : $arr['port'],
96105 $errno, $errstr, 30);
97106 if ($fp === FALSE) {