Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Converter/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public static function toLdapBoolean($value)
if (!is_scalar($value)) {
return $return;
}
if (true === $value || 'true' === strtolower($value) || 1 === $value) {
if (true === $value || (is_string($value) && 'true' === strtolower($value)) || 1 === $value) {
$return = 'TRUE';
}
return $return;
Expand Down Expand Up @@ -321,7 +321,9 @@ public static function fromLdapDateTime($date, $asUtc = true)
if (isset($off[3])) {
$offsetMinutes = substr($off[3], 0, 2);
if ($offsetMinutes < 0 || $offsetMinutes > 59) {
throw new Exception\InvalidArgumentException('Invalid date format found (invalid offset minute)');
throw new Exception\InvalidArgumentException(
'Invalid date format found (invalid offset minute)'
);
}
$time['offsetminutes'] = $offsetMinutes;
}
Expand Down

0 comments on commit 0044fc9

Please sign in to comment.