Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Change PHP keywords to comply with PSR2
Browse files Browse the repository at this point in the history
Signed-off-by: CodeLingoBot <bot@codelingo.io>
  • Loading branch information
CodeLingoBot committed Apr 15, 2019
1 parent fdd2cf4 commit eb169aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions Yubico.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function getParameters($parameters)
* @return mixed PEAR error on error, true otherwise
* @access public
*/
function verify($token, $use_timestamp=null, $wait_for_all=False,
function verify($token, $use_timestamp=null, $wait_for_all=false,
$sl=null, $timeout=null)
{
/* Construct parameters string */
Expand Down Expand Up @@ -314,8 +314,8 @@ function verify($token, $use_timestamp=null, $wait_for_all=False,

/* Execute and read request. */
$this->_response=null;
$replay=False;
$valid=False;
$replay=false;
$valid=false;
do {
/* Let curl do its work. */
while (($mrc = curl_multi_exec($mh, $active))
Expand Down Expand Up @@ -367,7 +367,7 @@ function verify($token, $use_timestamp=null, $wait_for_all=False,

$parameters=array('nonce','otp', 'sessioncounter', 'sessionuse', 'sl', 'status', 't', 'timeout', 'timestamp');
sort($parameters);
$check=Null;
$check=null;
foreach ($parameters as $param) {
if (array_key_exists($param, $response)) {
if ($check) $check = $check . '&';
Expand All @@ -382,22 +382,22 @@ function verify($token, $use_timestamp=null, $wait_for_all=False,
if($response['h'] == $checksignature) {
if ($status == 'REPLAYED_OTP') {
if (!$wait_for_all) { $this->_response = $str; }
$replay=True;
$replay=true;
}
if ($status == 'OK') {
if (!$wait_for_all) { $this->_response = $str; }
$valid=True;
$valid=true;
}
}
} else {
/* Case 3. We check the status directly */
if ($status == 'REPLAYED_OTP') {
if (!$wait_for_all) { $this->_response = $str; }
$replay=True;
$replay=true;
}
if ($status == 'OK') {
if (!$wait_for_all) { $this->_response = $str; }
$valid=True;
$valid=true;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

<?php
require_once 'Auth/Yubico.php';
$yubi = new Auth_Yubico($id, $key, NULL, $httpsverify);
$yubi = new Auth_Yubico($id, $key, null, $httpsverify);
if ($ask_url) {
$urls=explode(",", $url);
foreach($urls as $u) $yubi->addURLpart($u);
Expand Down
6 changes: 3 additions & 3 deletions example/Modhex.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ static function decode($token) {
$decoded = ""; // decoded string to be returned

// strings must have an even length
if ( $tokLen % 2 != 0 ) { return FALSE; }
if ( $tokLen % 2 != 0 ) { return false; }

for ($i = 0; $i < $tokLen; $i=$i+2 ) {
$high = strpos(ModHex::$TRANSKEY, $token[$i]);
$low = strpos(ModHex::$TRANSKEY, $token[$i+1]);

// if there's an invalid character in the encoded $token, fail here.
if ( $high === FALSE || $low === FALSE )
return FALSE;
if ( $high === false || $low === false )
return false;

$decoded .= chr(($high << 4) | $low);
}
Expand Down

0 comments on commit eb169aa

Please sign in to comment.