Skip to content

Commit 56a0c11

Browse files
committed
intValueSupported edge cases
Really should be <= PHP_INT_MAX and >= PHP_INT_MIN, but trying "(int)9.2233720368548E+18" results in PHP warning "The float 9.2233720368548E+18 is not representable as an int, cast occurred", a slightly more restrictive range avoids the edge-case warnings. #477
1 parent c234398 commit 56a0c11

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

getid3/getid3.lib.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ public static function CastAsInt($floatnum) {
118118
* @return bool
119119
*/
120120
public static function intValueSupported($num) {
121-
return (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN));
121+
// really should be <= and >= but trying "(int)9.2233720368548E+18" results in PHP warning "The float 9.2233720368548E+18 is not representable as an int, cast occurred"
122+
return (($num < PHP_INT_MAX) && ($num > PHP_INT_MIN));
122123
}
123124

124125
/**

getid3/getid3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class getID3
387387
*/
388388
protected $startup_warning = '';
389389

390-
const VERSION = '1.9.24-202601031725';
390+
const VERSION = '1.9.24-202601031735';
391391
const FREAD_BUFFER_SIZE = 32768;
392392

393393
const ATTACHMENTS_NONE = false;

0 commit comments

Comments
 (0)