Use setupHttpSocket for fetchPGPKey

pull/567/head
Richard van den Berg 2015-07-13 11:05:53 +02:00
parent 3f74ed0b39
commit 4b5bc3736a
1 changed files with 3 additions and 2 deletions

View File

@ -526,8 +526,9 @@ class User extends AppModel {
}
public function fetchPGPKey($email) {
App::uses('HttpSocket', 'Network/Http');
$HttpSocket = new HttpSocket();
App::uses('SyncTool', 'Tools');
$syncTool = new SyncTool();
$HttpSocket = $syncTool->setupHttpSocket();
$response = $HttpSocket->get('https://pgp.mit.edu/pks/lookup?search=' . $email . '&op=index&fingerprint=on');
if ($response->code != 200) return $response->code;
$string = str_replace(array("\r", "\n"), "", $response->body);