Skip to content

Commit

Permalink
Use better sorting algorithm to find newest HEPZ**** file
Browse files Browse the repository at this point in the history
  • Loading branch information
JVital2013 committed Oct 22, 2022
1 parent 66efb5a commit 64ba857
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion html/dataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@
//Get Title and identifier
$nameLineParts = preg_split('/ (Intermediate )?Advisory Number/', $nameLine);
$thisAdvisoryNumber = trim($nameLineParts[1]);
if(isset($returnData[$stormIdentifier]['latestAdvisory']) && strcmp($returnData[$stormIdentifier]['latestAdvisory'], $thisAdvisoryNumber) >= 0) break;
if(isset($returnData[$stormIdentifier]['latestAdvisory']) && strnatcmp($returnData[$stormIdentifier]['latestAdvisory'], $thisAdvisoryNumber) >= 0) break;

$returnData[$stormIdentifier]['title'] = $nameLineParts[0];
$returnData[$stormIdentifier]['latestAdvisory'] = $thisAdvisoryNumber;
Expand Down

0 comments on commit 64ba857

Please sign in to comment.