This website works better with JavaScript.
Home
Explore
Help
Sign In
nekobus
/
mastodon_neko
forked from
closed-social/mastodon
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
Don't create attachments if remote file cannot be fetched
master
Eugen Rochko
8 years ago
parent
882de42bab
commit
e4f56fa942
2 changed files
with
1 additions
and
3 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+0
-2
app/models/media_attachment.rb
+1
-1
app/services/process_feed_service.rb
+ 0
- 2
app/models/media_attachment.rb
View File
@ -22,8 +22,6 @@ class MediaAttachment < ApplicationRecord
def
file_remote_url
=
(
url
)
self
.
file
=
URI
.
parse
(
url
)
rescue
OpenURI
::
HTTPError
=
>
e
Rails
.
logger
.
debug
"
Error fetching remote attachment:
#{
e
}
"
end
def
image?
+ 1
- 1
app/services/process_feed_service.rb
View File
@ -173,7 +173,7 @@ class ProcessFeedService < BaseService
begin
media
.
file_remote_url
=
link
[
'href'
]
media
.
save
rescue
Paperclip
::
Errors
::
NotIdentifiedByImageMagickError
rescue
OpenURI
::
HTTPError
,
Paperclip
::
Errors
::
NotIdentifiedByImageMagickError
next
end
end
Write
Preview
Loading…
Cancel
Save