mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-01 17:57:25 +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:
parent
ad6054c600
commit
cf89d1e756
3 changed files with 24 additions and 5 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue