Skip to content

Commit

Permalink
Merge pull request #2 from mattandersen/master
Browse files Browse the repository at this point in the history
Fixes function scope and login issues
  • Loading branch information
Lucas Dohring committed Jul 25, 2013
2 parents fcbba57 + eb2ec89 commit 2fa73d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions snaphax.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ function login() {
!empty($out['auth_token'])) {
$this->auth_token = $out['auth_token'];
}
if ( is_array($out) && !empty($out['username']) ) {
$this->options['username'] = $out['username'];
}
return $out;
}
function friend($action, $friend, $display=NULL) {
Expand Down Expand Up @@ -234,11 +237,11 @@ function pkcs5pad($data) {
}

function decrypt($data) {
return mcrypt_decrypt('rijndael-128', $this->options['blob_enc_key'], pkcs5pad($data), 'ecb');
return mcrypt_decrypt('rijndael-128', $this->options['blob_enc_key'], SnaphaxApi::pkcs5pad($data), 'ecb');
}

function encrypt($data) {
return mcrypt_encrypt('rijndael-128', $this->options['blob_enc_key'], pkcs5pad($data), 'ecb');
return mcrypt_encrypt('rijndael-128', $this->options['blob_enc_key'], SnaphaxApi::pkcs5pad($data), 'ecb');
}

public function postCall($endpoint, $post_data, $param1, $param2, $json=1, $headers=false) {
Expand Down

0 comments on commit 2fa73d7

Please sign in to comment.