com web/bugs: Simplify marking related bugs a little: include/functions.php www/bug.php
| From: | sobak@php.net | Date: | Thu, 07 Aug 2014 04:16:11 +0000 |
| Subject: | com web/bugs: Simplify marking related bugs a little: include/functions.php www/bug.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-19649@lists.php.net to get a copy of this message | ||
Commit: 189219648a05ca2e39893e2947107526019bebba
Author: Sobak <msobaczewski@gmail.com> Thu, 7 Aug 2014 06:16:11 +0200
Parents: 1de55b7a5dd34d518256b2d6632e637cfb225c9f
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=189219648a05ca2e39893e2947107526019bebba
Log:
Simplify marking related bugs a little
Changed paths:
M include/functions.php
M www/bug.php
Diff:
diff --git a/include/functions.php b/include/functions.php
index 9995d4a..5eb42c8 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1858,9 +1858,6 @@ function make_mailto_link($email, $linktext = '', $extras =
'')
/**
* Turns bug/feature request numbers into hyperlinks
*
- * If the bug number is prefixed by the word "PHP, PEAR, PECL" the link will
- * go to correct bugs site. Otherwise, the bug is considered "local" bug.
- *
* @param string $text the text to check for bug numbers
*
* @return string the string with bug numbers hyperlinked
@@ -1880,7 +1877,7 @@ function get_ticket_links($text)
preg_match_all('/(?<![>a-z])(?:bug(?:fix)?|feat(?:ure)?|doc(?:umentation)?|req(?:uest)?|duplicated
of)\s+#?([0-9]+)/i', $text, $matches);
- return $matches;
+ return $matches[1];
}
function handle_pear_errors($error_obj)
diff --git a/www/bug.php b/www/bug.php
index bc85fd1..d8f8398 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -1188,8 +1188,8 @@ function mark_related_bugs($from, $comment_name, $ncomment)
/**
* Adds a new comment on the related bug pointing to the current report
*/
- for ($i = 0; $i < count($related[0]); ++$i) {
- bugs_add_comment($related[1][$i], $from, $comment_name,
+ foreach ($related as $bug) {
+ bugs_add_comment($bug, $from, $comment_name,
'Related To: Bug #'. $bug_id, 'related');
}
}