Massive number horse shit.
authorCameron Ball <c.ball1729@gmail.com>
Thu, 25 Dec 2014 12:08:38 +0000 (20:08 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Thu, 25 Dec 2014 12:08:38 +0000 (20:08 +0800)
Services/BannerExtracter.php
Services/SimfileParser.php

index 3b2928e..4133cfe 100644 (file)
@@ -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);
index 374bc17..fcb5618 100644 (file)
@@ -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
         );
     }