5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-02 04:54:17 +00:00

Merge branch 'issue-14953' into 'rails'

fix: eliminar los guiones bajos al principio del nombre de archivo #14953

See merge request sutty/sutty!237
This commit is contained in:
fauno 2024-03-05 19:41:19 +00:00
commit e1e55c84f4
3 changed files with 10 additions and 4 deletions

View file

@ -1,5 +1,5 @@
.apk-add: &apk-add
- "apk add go-task diffutils"
- "apk add go-task diffutils gitlab_ci_log_section"
.disable-hainish: &disable-hainish
- "rm -f .env.development"
.cache-ruby: &cache-ruby
@ -30,13 +30,18 @@ assets:
- *cache-node
- *cache-task
before_script:
- "gitlab_ci_log_section --name git --header=\"Configuring git\""
- "git config --global user.email \"${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}\""
- "git config --global user.name \"${GIT_USER_NAME:-$GITLAB_USER_NAME}\""
- "git remote set-url --push origin \"https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\""
- "gitlab_ci_log_section --name git --end"
- "gitlab_ci_log_section --name apk --header=\"Installing dependencies\""
- "apk add brotli"
- *apk-add
- *disable-hainish
- "gitlab_ci_log_section --name apk --end"
script:
- "gitlab_ci_log_section --name assets --header=\"Building\""
- "go-task assets"
after_script:
- "git add public && git commit -m \"ci: assets [skip ci]\""

View file

@ -18,8 +18,9 @@ module ActiveStorage
# para que puedan propagarse correctamente a través de todo el
# stack.
def blob_args
params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, metadata: {}).to_h.symbolize_keys.tap do |ba|
ba[:filename] = ba[:filename].unicode_normalize
params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type,
metadata: {}).to_h.symbolize_keys.tap do |ba|
ba[:filename] = ba[:filename].unicode_normalize.sub(/\A_+/, '')
end
end
end

View file

@ -11,7 +11,7 @@ module ActionDispatch
# Devolver el nombre de archivo con caracteres unicode
# normalizados
def original_filename
@original_filename.unicode_normalize
@original_filename.unicode_normalize.sub(/\A_+/, '')
end
end
end