Permalink
Browse files

Updated stuff to HTTPS endpoints. Haven't tested uploads or auth yet.

  • Loading branch information...
1 parent 206a66c commit 2b58ba4a4b84affa3958b350c4105d86b66687a5 @dan-coulter committed May 11, 2014
Showing with 8 additions and 16 deletions.
  1. +1 −1 README.md
  2. +7 −15 phpFlickr.php
View
@@ -19,7 +19,7 @@ Installation
The constructor has three arguments:
1. $api_key - This is the API key given to you by flickr.com. This
argument is required and you can get an API Key at:
- http://www.flickr.com/services/api/key.gne
+ https://www.flickr.com/services/api/keys/
2. $secret - The "secret" is optional because is not required to
make unauthenticated calls, but is absolutely required for the
View
@@ -23,9 +23,9 @@ class phpFlickr {
var $api_key;
var $secret;
- var $rest_endpoint = 'http://api.flickr.com/services/rest/';
- var $upload_endpoint = 'http://api.flickr.com/services/upload/';
- var $replace_endpoint = 'http://api.flickr.com/services/replace/';
+ var $rest_endpoint = 'https://api.flickr.com/services/rest/';
+ var $upload_endpoint = 'https://api.flickr.com/services/upload/';
+ var $replace_endpoint = 'https://api.flickr.com/services/replace/';
var $req;
var $response;
var $parsed_response;
@@ -205,10 +205,10 @@ function post ($data, $type = null) {
return call_user_func($this->custom_post, $url, $data);
}
- if ( !preg_match("|http://(.*?)(/.*)|", $url, $matches) ) {
+ if ( !preg_match("|https://(.*?)(/.*)|", $url, $matches) ) {
die('There was some problem figuring out your endpoint');
}
-
+
if ( function_exists('curl_init') ) {
// Has curl. Use it!
$curl = curl_init($this->rest_endpoint);
@@ -379,14 +379,6 @@ function buildPhotoURL ($photo, $size = "Medium") {
return $url;
}
- function getFriendlyGeodata ($lat, $lon) {
- /* I've added this method to get the friendly geodata (i.e. 'in New York, NY') that the
- * website provides, but isn't available in the API. I'm providing this service as long
- * as it doesn't flood my server with requests and crash it all the time.
- */
- return unserialize(file_get_contents('http://phpflickr.com/geodata/?format=php&lat=' . $lat . '&lon=' . $lon));
- }
-
function sync_upload ($photo, $title = null, $description = null, $tags = null, $is_public = null, $is_friend = null, $is_family = null) {
if ( function_exists('curl_init') ) {
// Has curl. Use it!
@@ -589,9 +581,9 @@ function auth ($perms = "read", $remember_uri = true) {
$api_sig = md5($this->secret . "api_key" . $this->api_key . "perms" . $perms);
if ($this->service == "23") {
- header("Location: http://www.23hq.com/services/auth/?api_key=" . $this->api_key . "&perms=" . $perms . "&api_sig=". $api_sig);
+ header("Location: https://www.23hq.com/services/auth/?api_key=" . $this->api_key . "&perms=" . $perms . "&api_sig=". $api_sig);
} else {
- header("Location: http://www.flickr.com/services/auth/?api_key=" . $this->api_key . "&perms=" . $perms . "&api_sig=". $api_sig);
+ header("Location: https://www.flickr.com/services/auth/?api_key=" . $this->api_key . "&perms=" . $perms . "&api_sig=". $api_sig);
}
exit;
} else {

0 comments on commit 2b58ba4

Please sign in to comment.