File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
apps/files_external/lib/Lib/Storage Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,7 @@ public function __construct($params) {
5050 $ this ->username = $ params ['user ' ];
5151 $ this ->password = $ params ['password ' ];
5252 if (isset ($ params ['secure ' ])) {
53- if (is_string ($ params ['secure ' ])) {
54- $ this ->secure = ($ params ['secure ' ] === 'true ' );
55- } else {
56- $ this ->secure = (bool )$ params ['secure ' ];
57- }
53+ $ this ->secure = is_string ($ params ['secure ' ]) ? ($ params ['secure ' ] === 'true ' ) : (bool ) $ params ['secure ' ];
5854 } else {
5955 $ this ->secure = false ;
6056 }
@@ -355,10 +351,12 @@ public function getDirectoryContent($directory): \Traversable {
355351
356352 $ data = [];
357353 $ data ['mimetype ' ] = $ isDir ? FileInfo::MIMETYPE_FOLDER : $ mimeTypeDetector ->detectPath ($ name );
358- $ data [ ' mtime ' ] = \DateTime::createFromFormat ('YmdGis ' , $ file ['modify ' ])-> getTimestamp ( );
359- if ($ data [ ' mtime ' ] === false ) {
354+ $ modifyDate = \DateTime::createFromFormat ('YmdGis ' , $ file ['modify ' ]);
355+ if ($ modifyDate === false ) {
360356 $ data ['mtime ' ] = time ();
361- }
357+ } else {
358+ $ data ['mtime ' ] = $ modifyDate ->getTimestamp ();
359+ }
362360 if ($ isDir ) {
363361 $ data ['size ' ] = -1 ; //unknown
364362 } elseif (isset ($ file ['size ' ])) {
You can’t perform that action at this time.
0 commit comments