@@ -176,7 +176,6 @@ private static function getVersionsSize($user) {
176176	 * store a new version of a file. 
177177	 */ 
178178	public  static  function  store ($ filename
179- 
180179		// if the file gets streamed we need to remove the .part extension 
181180		// to get the right target 
182181		$ extpathinfo ($ filenamePATHINFO_EXTENSION );
@@ -357,7 +356,6 @@ public static function renameOrCopy($sourcePath, $targetPath, $operation) {
357356	 * @return bool 
358357	 */ 
359358	public  static  function  rollback (string  $ fileint  $ revisionIUser $ user
360- 
361359		// add expected leading slash 
362360		$ filename'/ '  . ltrim ($ file'/ ' );
363361
@@ -495,11 +493,21 @@ public static function getVersions($uid, $filename, $userFullPath = '') {
495493					$ filename$ pathparts'filename ' ];
496494					if  ($ filename$ versionedFile
497495						$ pathpartspathinfo ($ entryName
498- 						$ timestampsubstr ($ pathparts'extension ' ], 1 );
496+ 						$ timestampsubstr ($ pathparts'extension ' ] ?? '' , 1 );
497+ 						if  (!is_numeric ($ timestamp
498+ 							\OC ::$ serverget (LoggerInterface::class)->error (
499+ 								'Version file {path} has incorrect name format ' ,
500+ 								[
501+ 									'path '  => $ entryName
502+ 									'app '  => 'files_versions ' ,
503+ 								]
504+ 							);
505+ 							continue ;
506+ 						}
499507						$ filename$ pathparts'filename ' ];
500508						$ key$ timestamp'# '  . $ filename
501509						$ versions$ key'version ' ] = $ timestamp
502- 						$ versions$ key'humanReadableTimestamp ' ] = self ::getHumanReadableTimestamp ($ timestamp
510+ 						$ versions$ key'humanReadableTimestamp ' ] = self ::getHumanReadableTimestamp (( int ) $ timestamp
503511						if  (empty ($ userFullPath
504512							$ versions$ key'preview ' ] = '' ;
505513						} else  {
@@ -578,7 +586,7 @@ public static function expireOlderThanMaxForUser($uid) {
578586	 * @param int $timestamp 
579587	 * @return string for example "5 days ago" 
580588	 */ 
581- 	private  static  function  getHumanReadableTimestamp ($ timestamp
589+ 	private  static  function  getHumanReadableTimestamp (int   $ timestamp:  string  {
582590		$ difftime () - $ timestamp
583591
584592		if  ($ diff60 ) { // first minute 
0 commit comments