svn: /web/php-bugs/trunk/include/ functions.php prepend.php
| From: | Daniel Egeberg | Date: | Sun, 18 Apr 2010 09:48:01 +0000 |
| Subject: | svn: /web/php-bugs/trunk/include/ functions.php prepend.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-7904@lists.php.net to get a copy of this message | ||
degeberg Sun, 18 Apr 2010 09:48:01 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298139
Log:
Fixed PHP bug #51586 (Wrong mailing list for "Documentation Problem" type bugs)
Bug: http://bugs.php.net/51586 (Open) Wrong mailing list for
"Documentation Problem" type bugs
Changed paths:
U web/php-bugs/trunk/include/functions.php
U web/php-bugs/trunk/include/prepend.php
Modified: web/php-bugs/trunk/include/functions.php
===================================================================
--- web/php-bugs/trunk/include/functions.php 2010-04-18 08:39:04 UTC (rev 298138)
+++ web/php-bugs/trunk/include/functions.php 2010-04-18 09:48:01 UTC (rev 298139)
@@ -760,7 +760,7 @@
$from = str_replace(array("\n", "\r"), '', $from);
/* Default addresses */
- list($mailto, $mailfrom, $Bcc) = get_package_mail(oneof($in['package_name'],
$bug['package_name']), $id);
+ list($mailto, $mailfrom, $Bcc) = get_package_mail(oneof($in['package_name'],
$bug['package_name']), $id, oneof($in['bug_type'], $bug['bug_type']));
$headers[] = array(' ID', $bug['id']);
@@ -1154,29 +1154,35 @@
*
* @return array an array of email addresses
*/
-function get_package_mail($package_name, $bug_id = false)
+function get_package_mail($package_name, $bug_id = false, $bug_type = 'Bug')
{
- global $dbh, $bugEmail;
+ global $dbh, $bugEmail, $docBugEmail;
$to = array();
- /* Get package mailing list address */
- $res = $dbh->prepare('
- SELECT list_email
- FROM bugdb_pseudo_packages
- WHERE name = ?
- ')->execute(array($package_name));
-
- if (PEAR::isError($res)) {
- throw new Exception('SQL Error in get_package_name(): ' . $res->getMessage());
+ if ($bugType === 'Documentation Problem') {
+ // Documentation problems *always* go to the doc team
+ $to[] = $docBugEmail;
}
-
- $list_email = $res->fetchOne();
-
- if ($list_email) {
- $to[] = $list_email;
- } else { // Fall back to default mailing list
- $to[] = $bugEmail;
+ else {
+ /* Get package mailing list address */
+ $res = $dbh->prepare('
+ SELECT list_email
+ FROM bugdb_pseudo_packages
+ WHERE name = ?
+ ')->execute(array($package_name));
+
+ if (PEAR::isError($res)) {
+ throw new Exception('SQL Error in get_package_name(): ' . $res->getMessage());
+ }
+
+ $list_email = $res->fetchOne();
+
+ if ($list_email) {
+ $to[] = $list_email;
+ } else { // Fall back to default mailing list
+ $to[] = $bugEmail;
+ }
}
/* Include assigned to To list and subscribers in Bcc list */
Modified: web/php-bugs/trunk/include/prepend.php
===================================================================
--- web/php-bugs/trunk/include/prepend.php 2010-04-18 08:39:04 UTC (rev 298138)
+++ web/php-bugs/trunk/include/prepend.php 2010-04-18 09:48:01 UTC (rev 298139)
@@ -20,6 +20,7 @@
'url' => 'bugs.php.net',
'basedir' => '',
'email' => 'php-bugs@lists.php.net',
+ 'doc_email' => 'doc-bugs@lists.php.net',
'security_email' => 'security@php.net',
'db_extension' => 'mysqli',
'db' => 'phpbugsdb',
@@ -36,6 +37,7 @@
$logged_in = false;
$site_url = $site_data['url'];
$bugEmail = $site_data['email'];
+$docBugEmail = $site_data['doc_email'];
$basedir = $site_data['basedir'];
define('BUG_PATCHTRACKER_TMPDIR', $site_data['patch_tmp']);
define('DATABASE_DSN',
"{$site_data['db_extension']}://{$site_data['db_user']}:{$site_data['db_pass']}@{$site_data['db_host']}/{$site_data['db']}");