Skip to content

Commit

Permalink
Version bump v1.1.12
Browse files Browse the repository at this point in the history
- Fix that allows "@" ("\x40") as first character in passwords. Fixes a
  security issue. See Issue #15
- Fix error message on empty email address. Introduced in 7a12003
  • Loading branch information
hakre committed Apr 5, 2013
1 parent f48b46c commit fa76685
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions DropboxUploader.php
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*
* @author Jaka Jancar [jaka@kubje.org] [http://jaka.kubje.org/]
* @version 1.1.11
* @version 1.1.12
*/
class DropboxUploader {
/**
Expand Down Expand Up @@ -77,7 +77,7 @@ public function __construct($email, $password) {
throw new Exception('DropboxUploader requires the cURL extension.', self::CODE_CURL_EXTENSION_MISSING);

if (empty($email) || empty($password)) {
throw new Exception(empty($email) ? 'Email' : 'Password' . ' must not be empty.', self::CODE_PARAMETER_TYPE_ERROR);
throw new Exception((empty($email) ? 'Email' : 'Password') . ' must not be empty.', self::CODE_PARAMETER_TYPE_ERROR);
}

$this->email = $email;
Expand Down Expand Up @@ -165,15 +165,15 @@ protected function login() {
'login_password' => (string) $this->password,
't' => $token
);
$data = $this->request(self::HTTPS_DROPBOX_COM_LOGIN, $postData);
$data = $this->request(self::HTTPS_DROPBOX_COM_LOGIN, http_build_query($postData));

if (stripos($data, 'location: /home') === FALSE)
throw new Exception('Login unsuccessful.', self::CODE_LOGIN_ERROR);

$this->loggedIn = TRUE;
}

protected function request($url, array $postData = NULL) {
protected function request($url, $postData = NULL) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, (string) $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
Expand Down

0 comments on commit fa76685

Please sign in to comment.