Skip to content

Commit

Permalink
fix https when use socket
Browse files Browse the repository at this point in the history
  • Loading branch information
fukata committed Dec 13, 2017
1 parent 0cb1155 commit 2db2493
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/PHPFlickr-Oauth/phpFlickr.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ function post ($data, $url='') {

$data = implode('&', $data);

$fp = @pfsockopen($matches[1], 80);
if (preg_match('|^https|', $url)) {
$fp = @pfsockopen('ssl://' . $matches[1], 443);
} else {
$fp = @pfsockopen($matches[1], 80);
}
if (!$fp) {
die('Could not connect to the web service');
}
Expand Down

0 comments on commit 2db2493

Please sign in to comment.