mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 12:43:24 +00:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user