mirror of
				https://github.com/discourse/discourse.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	FIX: Stop secure media URLs being censored too liberally in emails (#8817)
For example /t/ URLs were being replaced if they contained secure-media-uploads so if you made a topic called "Secure Media Uploads Are Cool" the View Topic link in the user notifications would be stripped out. Refactored code so this secure URL detection happens in one place.
This commit is contained in:
		@@ -128,7 +128,9 @@ class Upload < ActiveRecord::Base
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def self.secure_media_url?(url)
 | 
			
		||||
    url.include?(SECURE_MEDIA_ROUTE)
 | 
			
		||||
    # we do not want to exclude topic links that for whatever reason
 | 
			
		||||
    # have secure-media-uploads in the URL e.g. /t/secure-media-uploads-are-cool/223452
 | 
			
		||||
    url.include?(SECURE_MEDIA_ROUTE) && !url.include?("/t/") && FileHelper.is_supported_media?(url)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def self.signed_url_from_secure_media_url(url)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user