Skip to content

Commit

Permalink
Quick fixes/typo-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hubail committed Sep 13, 2012
1 parent 66ff843 commit 254e623
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/php/protocol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ protected function readList($token)
protected function readListSize($token)
{
$size = 0;
if ($token = 0xf8)
if ($token == 0xf8)
{
$size = $this->readInt8();
}
Expand Down
4 changes: 2 additions & 2 deletions src/php/whatsprot.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ protected function addAuth()

public function encryptPassword()
{
if(stristr($this->_imei,":")){
if(stripos($this->_imei, ":") !== false){
$this->_imei = strtoupper($this->_imei);
return md5($this->_imei.$this->_imei);
}
else{
else {
return md5(strrev($this->_imei));
}
}
Expand Down
9 changes: 3 additions & 6 deletions tests/whatsapp.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/php
<?php
/**
* 12-sep-2012 note: this is currently broken, to be fixed in the next push.
*/
require "../src/php/whatsprot.class.php";

function fgets_u($pStdn) {
Expand All @@ -16,9 +13,9 @@ function fgets_u($pStdn) {
}
}

$nickname = "Philipp";
$sender = "xxxxxxxxxxxx";
$imei = "xxxxxxxxxxxxxx"; //IMEI for Andorid or Mac Address for iOS
$nickname = "WhatsAPI Test";
$sender = "xxxxxxxxxxxx";
$imei = "xxxxxxxxxxxxxx"; //IMEI for Andorid or Mac Address for iOS


$countrycode = substr($sender,0,2);
Expand Down

0 comments on commit 254e623

Please sign in to comment.