Commit d57f5c70 authored by AW-UC's avatar AW-UC
Browse files

Fix sorting for files that only differ in case.

parent bc668600
......@@ -11,10 +11,13 @@ namespace OC;
class NaturalSort_DefaultCollator {
public function compare($a, $b) {
$result = strcasecmp($a, $b);
if ($result === 0) {
return 0;
}
return ($result < 0) ? -1 : 1;
$result = strcasecmp($a, $b);
if ($result === 0) {
if ($a === $b) {
return 0;
}
return ($a > $b) ? -1 : 1;
}
return ($result < 0) ? -1 : 1;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment