mirror of
https://dev.sigpipe.me/dashie/git.txt
synced 2025-10-06 02:22:41 +02:00
_ are now unstripped from filenames
This commit is contained in:
2
TODO.org
2
TODO.org
@@ -10,7 +10,7 @@
|
||||
** TODO Cleanup gogs imports of unused bits
|
||||
** TODO Add a field "filesystem filename" to add a real path to the gist file
|
||||
** TODO Should spawn an error if filename contains '/'
|
||||
** TODO _ shouldn't be stripped from filenames
|
||||
** DONE _ shouldn't be stripped from filenames
|
||||
** DONE Creation date on gitxt view
|
||||
** DONE Count of current gitxt
|
||||
** DONE Count of total managed gitxt
|
||||
|
@@ -6,10 +6,10 @@ package sanitize
|
||||
*/
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"bytes"
|
||||
"path"
|
||||
"regexp"
|
||||
"bytes"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// A very limited list of transliterations to catch common european names translated to urls.
|
||||
@@ -133,7 +133,7 @@ func cleanString(s string, r *regexp.Regexp) string {
|
||||
}
|
||||
|
||||
// We are very restrictive as this could be intended for ascii url slugs
|
||||
var illegalPath = regexp.MustCompile(`[^[:alnum:]\~\-\./]`)
|
||||
var illegalPath = regexp.MustCompile(`[^[:alnum:]\~\-\_\./]`)
|
||||
|
||||
// Filename will clean illegal characters
|
||||
func Filename(s string) string {
|
||||
@@ -145,4 +145,4 @@ func Filename(s string) string {
|
||||
|
||||
// NB this may be of length 0, caller must check
|
||||
return filePath
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user