Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29661 - lib/googleapi.php - Switch to SSL urls

I am not sure why I did not use these in the first instance, I don't
think Google supported SSL in the first versions of their API.

They do now, and it seems that this week they stopped supporting non-ssl
requests.
  • Loading branch information...
commit e0daa8499a4a26c419d435ae724faa7b9b595f7b 1 parent 7757237
Dan Poltawski danpoltawski authored samhemelryk committed
Showing with 9 additions and 11 deletions.
  1. +9 −11 lib/googleapi.php
20 lib/googleapi.php
View
@@ -241,8 +241,8 @@ public static function get_auth_header_name(){
*/
class google_docs {
// need both docs and the spreadsheets realm
- const REALM = 'http://docs.google.com/feeds/ http://spreadsheets.google.com/feeds/ http://docs.googleusercontent.com/';
- const DOCUMENTFEED_URL = 'http://docs.google.com/feeds/default/private/full';
+ const REALM = 'https://docs.google.com/feeds/ https://spreadsheets.google.com/feeds/ https://docs.googleusercontent.com/';
+ const DOCUMENTFEED_URL = 'https://docs.google.com/feeds/default/private/full';
const USER_PREF_NAME = 'google_authsub_sesskey';
private $google_curl = null;
@@ -292,8 +292,6 @@ public function get_file_list($search = ''){
$xml = new SimpleXMLElement($content);
-
-
$files = array();
foreach($xml->entry as $gdoc){
$docid = (string) $gdoc->children('http://schemas.google.com/g/2005')->resourceId;
@@ -307,15 +305,15 @@ public function get_file_list($search = ''){
switch($type){
case 'document':
$title = $gdoc->title.'.rtf';
- $source = 'http://docs.google.com/feeds/download/documents/Export?id='.$docid.'&exportFormat=rtf';
+ $source = 'https://docs.google.com/feeds/download/documents/Export?id='.$docid.'&exportFormat=rtf';
break;
case 'presentation':
$title = $gdoc->title.'.ppt';
- $source = 'http://docs.google.com/feeds/download/presentations/Export?id='.$docid.'&exportFormat=ppt';
+ $source = 'https://docs.google.com/feeds/download/presentations/Export?id='.$docid.'&exportFormat=ppt';
break;
case 'spreadsheet':
$title = $gdoc->title.'.xls';
- $source = 'http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key='.$docid.'&exportFormat=xls';
+ $source = 'https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key='.$docid.'&exportFormat=xls';
break;
case 'pdf':
$title = (string)$gdoc->title;
@@ -374,10 +372,10 @@ public function download_file($url, $fp){
class google_picasa {
const REALM = 'http://picasaweb.google.com/data/';
const USER_PREF_NAME = 'google_authsub_sesskey_picasa';
- const UPLOAD_LOCATION = 'http://picasaweb.google.com/data/feed/api/user/default/albumid/default';
- const ALBUM_PHOTO_LIST = 'http://picasaweb.google.com/data/feed/api/user/default/albumid/';
- const PHOTO_SEARCH_URL = 'http://picasaweb.google.com/data/feed/api/user/default?kind=photo&q=';
- const LIST_ALBUMS_URL = 'http://picasaweb.google.com/data/feed/api/user/default';
+ const UPLOAD_LOCATION = 'https://picasaweb.google.com/data/feed/api/user/default/albumid/default';
+ const ALBUM_PHOTO_LIST = 'https://picasaweb.google.com/data/feed/api/user/default/albumid/';
+ const PHOTO_SEARCH_URL = 'https://picasaweb.google.com/data/feed/api/user/default?kind=photo&q=';
+ const LIST_ALBUMS_URL = 'https://picasaweb.google.com/data/feed/api/user/default';
private $google_curl = null;
Please sign in to comment.
Something went wrong with that request. Please try again.