From 2f5abb8488de7d5e6ed9be173645c52299db9a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Goetz?= Date: Tue, 4 Aug 2015 22:40:24 +0200 Subject: [PATCH] Make sure the entries that just have a number work correctly --- libs/Tree/Builder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/Tree/Builder.php b/libs/Tree/Builder.php index bc7c528..3735ece 100644 --- a/libs/Tree/Builder.php +++ b/libs/Tree/Builder.php @@ -109,7 +109,11 @@ class Builder protected static function removeSortingInformations($filename, $separator = '_') { $filename = explode('_', $filename); - if ($filename[0] == '' || is_numeric($filename[0])) { + + // Remove the numeric part of the + // filename, only if there is + // something after that + if ($filename[0] == '' || (is_numeric($filename[0]) && array_key_exists(1, $filename))) { unset($filename[0]); } else { $t = $filename[0];