Closed (fixed)
Project:
Mime Mail
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Oct 2009 at 18:49 UTC
Updated:
26 Aug 2010 at 10:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
allie micka#319229: src="Array" if path to image is broken appears to be a duplicate of this issue, but it contains more followup, so I am closing this one and referring to followup there.
Comment #2
rmjiv commentedI just noticed that this issue was marked as a duplicate of #319229. Unfortunately, having read that thread, I don't think that it is. That thread is dealing with a problem related to private download method for files. This issue is problem where the regex match is overly aggressive and matches the characters "src" in places that it shouldn't.
I'm relatively terrible at regular expressions, but it may be as easy as changing line 87 from
$pattern = '/(<link[^>]+href=[\'"]?|<object[^>]+codebase=[\'"]?|@import |src=[\'"]?)([^\'>"]+)([\'"]?)/emis';to$pattern = '/(<link[^>]+href=[\'"]?|<object[^>]+codebase=[\'"]?|@import | src=[\'"]?)([^\'>"]+)([\'"]?)/emis';The goal being to match "src" only if it is preceded with a space.
But I'm not sure that is even 100% right. Really what should happen is that
tag.
srcis only matched as an attribute of anComment #3
jerdavisThis code has changed in the latest release, alpha2 for a security advisory. Please review your change against this code. You should update your site to use a derivative of alpha2 as soon as possible.
Comment #4
rmjiv commentedThanks for the heads up on the security advisory. But that only removes the
/eswitch from the pattern which doesn't affect this either way. The pattern is still wrong in alpha 2.Comment #5
sgabe commentedI can confirm this issue. I am attaching a patch against current HEAD with the fix in #2.
Comment #6
sgabe commentedThe previous patch is not good enough, it misses the case in which there is a line break or tab before the attribute. I'm attaching a new one which checks src attributes with any (\s) preceding white-space character.
Comment #7
sgabe commentedCommitted to HEAD.