From: Cameron Ball Date: Thu, 25 Dec 2014 12:08:38 +0000 (+0800) Subject: Massive number horse shit. X-Git-Url: http://git.cameron1729.xyz/?p=rock.divinelegy.git;a=commitdiff_plain;h=fa3bd2b531862547471795e0d32f5811b92fa30b Massive number horse shit. --- diff --git a/Services/BannerExtracter.php b/Services/BannerExtracter.php index 3b2928e..4133cfe 100644 --- a/Services/BannerExtracter.php +++ b/Services/BannerExtracter.php @@ -29,7 +29,9 @@ class BannerExtracter implements IBannerExtracter for($i=0; $i<$za->numFiles; $i++) { $stat = $za->statIndex($i); - if(basename($stat['name']) == $bannerName) + $type = @exif_imagetype('zip://' . realpath($zipfile) . '#' . $stat['name']); + //Sometimes simfiles specify a video as their banner. Fuck dat. + if(basename($stat['name']) == $bannerName && $type !== false) { $this->_hash = md5_file('zip://' . $zipfile . '#' . $stat['name']); $this->_destinationFileName = $this->_hash . '.' . pathinfo($bannerName, PATHINFO_EXTENSION); diff --git a/Services/SimfileParser.php b/Services/SimfileParser.php index 374bc17..fcb5618 100644 --- a/Services/SimfileParser.php +++ b/Services/SimfileParser.php @@ -150,7 +150,8 @@ class SimfileParser implements ISimfileParser new \Domain\VOs\StepMania\Difficulty($stepData[2]), empty($stepData[1]) ? null : new \Domain\VOs\StepMania\StepArtist(utf8_encode($stepData[1])), //XXX: Fuck you whoever made me do this. http://dev.mysql.com/doc/refman/5.5/en/integer-types.html - $stepData[3] <= 18446744073709551615 ? $stepData[3] : 9999999999999999999 + //XXX: Originally I was using MySQL unsigned bigint max value, but PHP does not have unsigned ints so + $stepData[3] <= 9223372036854775807 ? $stepData[3] : 9223372036854775807 ); }