Skip to content

Commit

Permalink
Close loophole in validation of media_file_url
Browse files Browse the repository at this point in the history
Closes #333
  • Loading branch information
walter committed Feb 9, 2014
1 parent 8af6bd4 commit a8a0f38
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ def copy_coordinates_from_user
def modify_media_file_url_if_from_video_site
if media_file_url.present? && !ImageSrcUrl.new(media_file_url).is_image?
video_src_url = VideoSrcUrl.new(media_file_url)
self.media_file_url = video_src_url.value if video_src_url.is_video?
if video_src_url.is_video?
self.media_file_url = video_src_url.value
else
self.media_file_url = "Image or video for sure? #{media_file_url}"
end
end
end
end

0 comments on commit a8a0f38

Please sign in to comment.