gwynne Thu, 16 Jul 2009 00:56:35 +0000 URL: http://svn.php.net/viewvc?view=revision&revision=284162
Changed paths: U SVNROOT/commit-email.php U SVNROOT/pre-commit Log: okay, you win. One more attempt at doing the Q-encoding properly. Also, by ridiculously popular request, the file names in subject lines are back. Finally, a link to an explanation is given for keywords failures. Modified: SVNROOT/commit-email.php =================================================================== --- SVNROOT/commit-email.php 2009-07-16 00:52:42 UTC (rev 284161) +++ SVNROOT/commit-email.php 2009-07-16 00:56:35 UTC (rev 284162) @@ -121,8 +121,10 @@ $saw_last_ISO = TRUE; } if ($username === $commit_user) { - $fullname = str_replace(array('~', "'", '"'), '', iconv($saw_last_ISO ? "UTF-8" : "ISO-8859-1", "ASCII//TRANSLIT", $fullname)); - $from = "\"{$fullname}\" <{$userna...@php.net>"; + if ($saw_last_ISO === TRUE) { + $fullname = iconv("ISO-8859-1", "UTF-8//TRANSLIT", $fullname); + } + $from = array($username, $fullname); break; } } @@ -163,12 +165,23 @@ // ----------------------------------------------------------------------------------------------------------------------------- // Build e-mail $boundary = sha1("{$commit_user}{$commit_date}"); +$messageid = "{$boundary}" . mt_rand(); +$subject = "svn: {$parent_path}"; +foreach ($changed_paths as $changed_path) { + $changed_path = trim(strstr($changed_path, ' ')); + if (substr($changed_path, -1) !== '/') { + $subject .= ' ' . substr($changed_path, $parent_path === '/' ? 0 : strlen($parent_path)); + } +} +$subject = substr($subject, 0, 950); // Max SMTP line length = 998. Some slop in this value. -$msg_headers = "From: {$from}\r\n" . +$fullname = "=?utf-8?q?" . imap_8bit(str_replace(array('?', ' '), array('=3F', '_'), $from[1])) . "?="; + +$msg_headers = "From: {$fullname} <{$from[...@php.net>\r\n" . "To: " . implode(', ', $emails_to) . "\r\n" . - "Message-ID: <svn{$commit_user}{$commit_da...@svn.php.net>\r\n" . + "Message-ID: <svn{$message...@svn.php.net>\r\n" . "Date: " . date(DATE_RFC822, $commit_date) . "\r\n" . - "Subject: svn: {$parent_path}\r\n" . + "Subject: {$subject}\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed; boundary=\"{$boundary}\"\r\n"; Modified: SVNROOT/pre-commit =================================================================== --- SVNROOT/pre-commit 2009-07-16 00:52:42 UTC (rev 284161) +++ SVNROOT/pre-commit 2009-07-16 00:56:35 UTC (rev 284162) @@ -209,7 +209,7 @@ print "DEBUG: File is non-binary. Checking for keywords.\n"; } if (!in_array('svn:keywords', $properties)) { - fail("svn:keywords not set on textual file {$path_added}.\n"); + fail("svn:keywords not set on textual file {$path_added}. Please see section 5 of http://darkrainfall.org/phpsvn-guide.html for instructions.\n"); } if ($is_DEBUG) { print "DEBUG: File has keywords. Moving on.\n";
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php