Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off-by-one in tootctl media commands #30306

Merged
merged 1 commit into from
May 15, 2024

Conversation

ClearlyClaire
Copy link
Contributor

Fixes #30281

File paths for attachments are of the form :model_name/:attribute_name/:id_pt1/:id_pt2/…/:style/:filename (e.g. site_uploads/files/000/000/002/original/4919ef8c0b4e8d59.png) and the path_segments[2..-2] returned [':id_pt1', ':id_pt2', …, ':style'], incorrectly including :style.

This did not get noticed up until now because :style was never a numeric, so calling #to_i always silently stripped it. However, icon styles are numeric, and thus were incorrectly added to the reconstructed identifier.

@ClearlyClaire ClearlyClaire added bug Something isn't working to backport PR needed to be backported labels May 15, 2024
@ClearlyClaire ClearlyClaire requested a review from a team May 15, 2024 12:46
@ClearlyClaire ClearlyClaire added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit c2ca3d1 May 15, 2024
55 checks passed
@ClearlyClaire ClearlyClaire deleted the fixes/remove-orphans-off-by-one branch May 15, 2024 13:16
@ClearlyClaire ClearlyClaire mentioned this pull request May 16, 2024
@ClearlyClaire ClearlyClaire removed the to backport PR needed to be backported label May 17, 2024
This was referenced May 29, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Jun 1, 2024
Ember-ruby pushed a commit to Ember-ruby/mastodon-glitch that referenced this pull request Jun 9, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Jun 26, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Jun 26, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Jun 26, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Jun 26, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Jun 26, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Jun 27, 2024
ttrace pushed a commit to ttrace/mastodon that referenced this pull request Jul 5, 2024
atsu1125 pushed a commit to atsu1125/mastodon that referenced this pull request Jul 6, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Sep 9, 2024
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Favicon is considered orphaned media
2 participants