Fix PHP byte validation and reenable builds (#7670)

* Fix PHP byte validation and reenable builds

* Use checkout@v3

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
Louis Laugesen
2022-11-30 03:12:28 +11:00
committed by GitHub
parent ad6054c600
commit cf89d1e756
3 changed files with 24 additions and 5 deletions

View File

@@ -486,7 +486,12 @@ class ByteBuffer
}
private static function validateValue($min, $max, $value, $type, $additional_notes = "") {
if(!($min <= $value && $value <= $max)) {
if (
!(
($type === "byte" && $min <= ord($value) && ord($value) <= $max) ||
($min <= $value && $value <= $max)
)
) {
throw new \InvalidArgumentException(sprintf("bad number %s for type %s.%s", $value, $type, $additional_notes));
}
}