diff --git a/assets/snippets/ddTools/modx.ddtools.class.php b/assets/snippets/ddTools/modx.ddtools.class.php index 8e8e9e3..265499f 100644 --- a/assets/snippets/ddTools/modx.ddtools.class.php +++ b/assets/snippets/ddTools/modx.ddtools.class.php @@ -1,11 +1,11 @@ File name; 'version' => File version. + * @return {array: associative} - Array of: 'name' {string} => File name; 'version' => File version; 'extension' => File extension. */ public static function parseFileNameVersion($file){ //Если сразу передали массив @@ -727,7 +727,11 @@ public static function parseFileNameVersion($file){ } //Fail by default - $result = array('name' => strtolower($file), 'version' => '0'); + $result = array( + 'name' => strtolower($file), + 'version' => '0', + 'extension' => !$fileinfo['extension'] ? '' : $fileinfo['extension'] + ); //Try to get file version [0 — full name, 1 — script name, 2 — version, 3 — all chars after version] preg_match('/(\D*?)-?(\d(?:\.\d+)*(?:-?[A-Za-z])*)(.*)/', $fileinfo['basename'], $match);