From e0daa8499a4a26c419d435ae724faa7b9b595f7b Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Thu, 6 Oct 2011 12:46:11 +0100 Subject: [PATCH] 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. --- lib/googleapi.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/googleapi.php b/lib/googleapi.php index cb09710cb2a..af545a095ab 100644 --- a/lib/googleapi.php +++ b/lib/googleapi.php @@ -241,8 +241,8 @@ class google_authsub extends google_auth_request { */ 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 @@ class google_docs { $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 @@ class google_docs { 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 @@ class google_docs { 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;