vendor/plugins/attachment_fu_hacks/lib/attachment_fu_hacks.rb
# Downcase and remove extra underscores from uploaded images
Downcase and remove extra underscores from uploaded images
Downcase and remove extra underscores from uploaded images
def sanitize_filename(filename)
    returning filename.strip do |name|
      name.gsub! /^.*(\\|\/)/, ''
      name.gsub! /[^A-Za-z0-9\.\-]/, '_'
      name.gsub!(/\_+/, '_')
      name.downcase!
    end
  end
def sanitize_filename ( filename ) returning filename . strip do | name | name . gsub! / ^.*( \\ | \/ ) / , '' name . gsub! / [^A-Za-z0-9 \. \- ] / , '_' name . gsub! ( / \_ + / , '_' ) name . downcase! end end
Downcase and remove extra underscores from uploaded images
Downcase and remove extra underscores from uploaded images
# NOTE: File.basename doesn't work right with Windows paths on Unix # get only the filename, not the whole path # Finally, replace all non alphanumeric, underscore or periods with underscore # Remove multiple underscores # Downcase result including extension
filename
<not_specific>