@@ -623,20 +623,23 @@ func createFolderRow(file fs.DirEntry, currentPath string, fileInfo os.FileInfo)
623623 encodedPath := createEncodedPath (currentPath , file .Name ())
624624 escapedencodedFilePath := html .EscapeString (encodedPath )
625625
626- folderLink := fmt .Sprintf (`<a href="/?path=%s">%s</a>` , escapedencodedFilePath , file .Name ())
626+ escapedFolderName := html .EscapeString (file .Name ())
627+ folderLink := fmt .Sprintf (`<a href="/?path=%s">%s</a>` , escapedencodedFilePath , escapedFolderName )
628+ lastModified := fileInfo .ModTime ().Format ("2006-01-02 15:04:05" )
627629 return fmt .Sprintf (`
628- <tr>
629- <td>%s</td>
630- <td>%s</td>
631- <td>-</td>
632- <td>-</td>
633- <td>
634- <div class="action-buttons">
635- <span>-</span>
636- </div>
637- </td>
638- </tr>
639- ` , folderLink , fileInfo .Mode ())
630+ <tr>
631+ <td>%s</td>
632+ <td>%s</td>
633+ <td>-</td>
634+ <td>%s</td>
635+ <td>-</td>
636+ <td>
637+ <div class="action-buttons">
638+ <span>-</span>
639+ </div>
640+ </td>
641+ </tr>
642+ ` , folderLink , fileInfo .Mode (), lastModified )
640643}
641644
642645func createFileRow (file fs.DirEntry , currentPath string , fileInfo os.FileInfo ) string {
@@ -654,7 +657,7 @@ func createFileRow(file fs.DirEntry, currentPath string, fileInfo os.FileInfo) s
654657 customPath , exists := customPaths [filePath ]
655658 fmt .Println (currentPath )
656659 if exists {
657- customPathDisplay = customPath
660+ customPathDisplay = html . EscapeString ( customPath )
658661 }
659662 // Determinar si el archivo es legible (texto)
660663 isReadableFile := isTextFile (file .Name ())
@@ -671,20 +674,22 @@ func createFileRow(file fs.DirEntry, currentPath string, fileInfo os.FileInfo) s
671674 }
672675
673676 fileSize , units := formatFileSize (fileInfo .Size ())
677+ lastModified := fileInfo .ModTime ().Format ("2006-01-02 15:04:05" )
674678
675679 return fmt .Sprintf (`
676- <tr>
677- <td>%s</td>
678- <td>%s</td>
679- <td>%.2f %s</td>
680- <td>%s</td>
681- <td>
682- <div class="action-buttons">
683- %s%s%s%s%s
684- </div>
685- </td>
686- </tr>
687- ` , escapedFileName , fileInfo .Mode (), fileSize , units , customPathDisplay ,
680+ <tr>
681+ <td>%s</td>
682+ <td>%s</td>
683+ <td>%.2f %s</td>
684+ <td>%s</td>
685+ <td>%s</td>
686+ <td>
687+ <div class="action-buttons">
688+ %s%s%s%s%s
689+ </div>
690+ </td>
691+ </tr>
692+ ` , escapedFileName , fileInfo .Mode (), fileSize , units , lastModified , customPathDisplay ,
688693 downloadLink , copyURLButton , customPathButton , searchButton , deleteLink )
689694}
690695
0 commit comments