Project

General

Profile

Defect #15666 ยป parse_inline_attachments.diff

Ilya S, 2013-12-10 11:30

View differences:

app/helpers/application_helper.rb
584 584
    attachments += obj.attachments if obj.respond_to?(:attachments)
585 585
    if attachments.present?
586 586
      text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpe|jpeg|png))"(\s+alt="([^"]*)")?/i) do |m|
587
        filename, ext, alt, alttext = $1.downcase, $2, $3, $4
587
        filename, text, alt, alttext = $1.downcase, $2, $3, $4
588 588
        # search for the picture in attachments
589 589
        if found = Attachment.latest_attach(attachments, filename)
590 590
          image_url = download_named_attachment_path(found, found.filename, :only_path => only_path)
    (1-1/1)