[svn-commits] jpeeler: mantis/trunk r131 - /mantis/trunk/bug_commit_message_do.php

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 25 18:25:38 CDT 2009


Author: jpeeler
Date: Tue Aug 25 18:25:33 2009
New Revision: 131

URL: http://svn.asterisk.org/svn-view/thirdparty?view=rev&rev=131
Log:
Fix commit message template to properly handle patch submissions made with a
user containing a space in the name.

Modified:
    mantis/trunk/bug_commit_message_do.php

Modified: mantis/trunk/bug_commit_message_do.php
URL: http://svn.asterisk.org/svn-view/thirdparty/mantis/trunk/bug_commit_message_do.php?view=diff&rev=131&r1=130&r2=131
==============================================================================
--- mantis/trunk/bug_commit_message_do.php (original)
+++ mantis/trunk/bug_commit_message_do.php Tue Aug 25 18:25:33 2009
@@ -63,10 +63,12 @@
 
 	if (count($patches)) {
 		echo "Patches: <br />\n";
+		$mymatches = array();
 		foreach($patches as $p) {
-			$p = explode("_", $p);
-			$patch_id = $p[0];
-			$patch_user = $p[1];
+			# 12345_Some_Name
+			preg_match('/(?<id>\d+)_(?<user>\w+)/', $p, $mymatches);
+			$patch_id = $mymatches['id'];
+			$patch_user = str_replace("_", " ", $mymatches['user']);
 			$license = license_on_file_for_upload($patch_id, true);
 			$file = get_attachment_by_id($files, $patch_id);
 			echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {$file["filename"]} uploaded by {$patch_user}";




More information about the svn-commits mailing list