Skip to content

Commit

Permalink
bugfix: #247 array_min incorrect return value
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHeinrich committed May 21, 2020
1 parent 581ee56 commit 13dc22a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions getid3/getid3.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,10 @@ public static function CreateDeepArray($ArrayPath, $Separator, $Value) {
*/
public static function array_max($arraydata, $returnkey=false) {
$maxvalue = false;
$maxkey = false;
$maxkey = false;
foreach ($arraydata as $key => $value) {
if (!is_array($value)) {
if ($value > $maxvalue) {
if (($maxvalue === false) || ($value > $maxvalue)) {
$maxvalue = $value;
$maxkey = $key;
}
Expand All @@ -701,10 +701,10 @@ public static function array_max($arraydata, $returnkey=false) {
*/
public static function array_min($arraydata, $returnkey=false) {
$minvalue = false;
$minkey = false;
$minkey = false;
foreach ($arraydata as $key => $value) {
if (!is_array($value)) {
if ($value > $minvalue) {
if (($minvalue === false) || ($value < $minvalue)) {
$minvalue = $value;
$minkey = $key;
}
Expand Down
2 changes: 1 addition & 1 deletion getid3/getid3.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class getID3
*/
protected $startup_warning = '';

const VERSION = '1.9.19-202005171610';
const VERSION = '1.9.19-202005202246';
const FREAD_BUFFER_SIZE = 32768;

const ATTACHMENTS_NONE = false;
Expand Down

0 comments on commit 13dc22a

Please sign in to comment.