com web/pres2: Ouch, bad sort function here: index.php
| From: | Rasmus Lerdorf | Date: | Mon, 19 Jan 2015 05:08:44 +0000 |
| Subject: | com web/pres2: Ouch, bad sort function here: index.php | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-2018@lists.php.net to get a copy of this message | ||
Commit: c9574f041b72a37516cdb9ed765f5b5e94cd96ae
Author: Rasmus Lerdorf <rasmus@php.net> Sun, 18 Jan 2015 21:08:44 -0800
Parents: 1ccda1ef00fb9655ef2938b0237ec06b54380223
Branches: master
Link: http://git.php.net/?p=web/pres2.git;a=commitdiff;h=c9574f041b72a37516cdb9ed765f5b5e94cd96ae
Log:
Ouch, bad sort function here
Changed paths:
M index.php
Diff:
diff --git a/index.php b/index..php
index 48673ec..e1425d6 100644
--- a/index.php
+++ b/index.php
@@ -219,7 +219,7 @@ switch($display_mode) {
$prnum = sizeof($pr);
function cmp($a,$b) {
- return strtotime($a['date']) < strtotime($b['date']);
+ return strtotime($b['date']) - strtotime($a['date']);
}
usort($pr,'cmp');