Skip to content

Commit

Permalink
Fix warnings emitted in PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dapphp committed Jan 26, 2022
1 parent c75d351 commit 41960b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/MsChapV2Packet.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MsChapV2Packet
const OPCODE_CHANGEPASS = 7;

public $opcode;
public $msChapId;
public $msChapId = 0;
public $msLength;
public $valueSize;
public $challenge;
Expand Down
16 changes: 8 additions & 8 deletions src/Radius.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,9 @@ public function setAttribute($type, $value)
case 'I':
// Integer, 32 bit unsigned value, most significant octet first.
$temp = chr($type) . chr(6) .
chr(($value / (256 * 256 * 256)) % 256) .
chr(($value / (256 * 256)) % 256) .
chr(($value / (256)) % 256) .
chr(intval(($value / (256 * 256 * 256))) % 256) .
chr(intval(($value / (256 * 256))) % 256) .
chr(intval(($value / (256))) % 256) .
chr($value % 256);
break;
case 'D':
Expand Down Expand Up @@ -1205,7 +1205,7 @@ public function accessRequestEapMsChapV2($username, $password)
->setAttribute(79, $eapPacket)
->setIncludeMessageAuthenticator();

$resp = $this->accessRequest(null, null, 0, $state);
$resp = $this->accessRequest('', '', 0, $state);

if (!$resp) {
return false;
Expand Down Expand Up @@ -1267,7 +1267,7 @@ public function accessRequestEapMsChapV2($username, $password)
->setAttribute(79, $eapPacket)
->setIncludeMessageAuthenticator();

$this->accessRequest(null, null, 0, $state);
$this->accessRequest('', '', 0, $state);

if ($this->errorCode) {
return false;
Expand Down Expand Up @@ -1341,7 +1341,7 @@ public function accessRequestEapMsChapV2($username, $password)
->setAttribute(79, $eapPacket)
->setIncludeMessageAuthenticator();

return $this->accessRequest(null, null, 0, $state);
return $this->accessRequest('', '', 0, $state);
}

/**
Expand Down Expand Up @@ -1476,7 +1476,7 @@ public function changePasswordEapMsChapV2($username, $password, $newPassword)
->setAttribute(79, $eapPacketSplit[2])
->setIncludeMessageAuthenticator();

$resp = $this->accessRequest(null, null, 0, $state);
$resp = $this->accessRequest('', '', 0, $state);

if ($this->errorCode) {
$this->errorMessage = 'Password change rejected; new password may not meet the password policy requirements';
Expand All @@ -1494,7 +1494,7 @@ public function changePasswordEapMsChapV2($username, $password, $newPassword)
->setIncludeMessageAuthenticator();

// returns true if password changed successfully
return $this->accessRequest(null, null, 0, $state);
return $this->accessRequest('', '', 0, $state);
}

/**
Expand Down

0 comments on commit 41960b6

Please sign in to comment.