Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 78593 invoked from network); 13 Jul 2010 10:14:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Jul 2010 10:14:18 -0000 Received: (qmail 55211 invoked by uid 500); 13 Jul 2010 10:14:18 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 54854 invoked by uid 500); 13 Jul 2010 10:14:14 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 54847 invoked by uid 99); 13 Jul 2010 10:14:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jul 2010 10:14:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jul 2010 10:14:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CD1052388903; Tue, 13 Jul 2010 10:13:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r963657 - in /commons/proper/email/trunk/src: java/org/apache/commons/mail/ImageHtmlEmail.java test/org/apache/commons/mail/ImageHtmlEmailTest.java Date: Tue, 13 Jul 2010 10:13:17 -0000 To: commits@commons.apache.org From: sgoeschl@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100713101317.CD1052388903@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sgoeschl Date: Tue Jul 13 10:13:17 2010 New Revision: 963657 URL: http://svn.apache.org/viewvc?rev=963657&view=rev Log: [EMAIL-92] Updated the regular expression which also fixed a broken test Modified: commons/proper/email/trunk/src/java/org/apache/commons/mail/ImageHtmlEmail.java commons/proper/email/trunk/src/test/org/apache/commons/mail/ImageHtmlEmailTest.java Modified: commons/proper/email/trunk/src/java/org/apache/commons/mail/ImageHtmlEmail.java URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/java/org/apache/commons/mail/ImageHtmlEmail.java?rev=963657&r1=963656&r2=963657&view=diff ============================================================================== --- commons/proper/email/trunk/src/java/org/apache/commons/mail/ImageHtmlEmail.java (original) +++ commons/proper/email/trunk/src/java/org/apache/commons/mail/ImageHtmlEmail.java Tue Jul 13 10:13:17 2010 @@ -54,11 +54,11 @@ public class ImageHtmlEmail extends Html * newlines on any place, HTML is not case sensitive and there can be * arbitrary text between "IMG" and "SRC" like IDs and other things. */ - public static final String REGEX_IMG_SRC = "(<[Ii][Mm][Gg]\\s*[^>]*?\\s+[Ss][Rr][Cc]\\s*=s*[\"'])([^\"']+?)([\"'])"; + public static final String REGEX_IMG_SRC = "(<[Ii][Mm][Gg]\\s*[^>]*?\\s+[Ss][Rr][Cc]\\s*=\\s*[\"'])([^\"']+?)([\"'])"; public static final String REGEX_SCRIPT_SRC = "(<[Ss][Cc][Rr][Ii][Pp][Tt]\\s*.*?\\s+[Ss][Rr][Cc]\\s*=\\s*[\"'])([^\"']+?)([\"'])"; - // this pattern looks for the HTML imgage tag which indicates embedded images, + // this pattern looks for the HTML image tag which indicates embedded images, // the grouping is necessary to allow to replace the element with the CID protected static final Pattern pattern = Pattern.compile(REGEX_IMG_SRC); @@ -164,7 +164,7 @@ public class ImageHtmlEmail extends Html { String name = imageDataSource.getName(); String cid = (String) cidCache.get(name); - + if(cid == null) { cid = embed(imageDataSource, imageDataSource.getName()); Modified: commons/proper/email/trunk/src/test/org/apache/commons/mail/ImageHtmlEmailTest.java URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/org/apache/commons/mail/ImageHtmlEmailTest.java?rev=963657&r1=963656&r2=963657&view=diff ============================================================================== --- commons/proper/email/trunk/src/test/org/apache/commons/mail/ImageHtmlEmailTest.java (original) +++ commons/proper/email/trunk/src/test/org/apache/commons/mail/ImageHtmlEmailTest.java Tue Jul 13 10:13:17 2010 @@ -253,14 +253,12 @@ public class ImageHtmlEmailTest extends assertEquals("http://dstadler2.org/", matcher.group(2)); // what about newlines and other whitespaces - /* matcher = pattern .matcher(""); assertTrue(matcher.find()); assertEquals("http://dstadler1.org/", matcher.group(2)); assertTrue(matcher.find()); assertEquals("http://dstadler2.org/", matcher.group(2)); - */ // what about some real markup matcher = pattern.matcher("