Advertisement
stronk7

Untitled

Nov 11th, 2020
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.00 KB | None | 0 0
  1. $ diff lib.php libt.php -u
  2. --- lib.php     2020-11-07 17:45:07.080471992 +0800
  3. +++ libt.php    2020-11-12 01:50:39.854292981 +0800
  4. @@ -374,9 +374,9 @@
  5.      // Sort candidates by maturity desc (stable first, alpha last).
  6.      krsort($candidates, SORT_NUMERIC);
  7.  
  8. -    // Within each maturity, sort by branch desc (3.0 before 2.9).
  9. +    // Within each maturity, sort by branch desc (3.0 before 2.9, 3.10 before 3.9).
  10.      foreach (array_keys($candidates) as $maturity) {
  11. -        krsort($candidates[$maturity], SORT_NUMERIC);
  12. +        krsort($candidates[$maturity], SORT_NATURAL);
  13.      }
  14.  
  15.      // Attempt to find the most mature version. Note that we are preferring
  16. @@ -389,7 +389,7 @@
  17.  
  18.      // First try to find in the requested branch or lower.
  19.      foreach ($finalists as $supportedbranch => $version) {
  20. -        if ((double)$supportedbranch > $targetbranch) {
  21. +        if (version_compare($supportedbranch, $targetbranch, '>')) {
  22.              continue;
  23.          } else {
  24.              return $version;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement