Author: Sara Golemon (sgolemon)
Date: 2021-11-03T15:48:24Z
Commit:
https://github.com/php/web-php/commit/8743f6c518c949fd444dc7c3eb1239b085ac98bf
Raw diff:
https://github.com/php/web-php/commit/8743f6c518c949fd444dc7c3eb1239b085ac98bf.diff
Minor refactor for NEWS rewrite rules
Changed paths:
M bin/news2html
Diff:
diff --git a/bin/news2html b/bin/news2html
index 92109839b..47cde57b1 100755
--- a/bin/news2html
+++ b/bin/news2html
@@ -60,6 +60,13 @@ echo <<<HEAD
<ul>
HEAD;
+$bug_map = [
+ '/Fixed bug #([0-9]+)/' => '<?php bugfix(\1); ?'.'>',
+ '/Fixed PECL bug #([0-9]+)/' => '<?php peclbugfix(\1); ?'.'>',
+ '/Implemented FR #([0-9]+)/' => '<?php implemented(\1); ?'.'>',
+ '/GitHub PR #([0-9]+)/' => '<?php githubissuel(\'php/php-src\',\1);
?'.'>',
+];
+
foreach($entries as $module => $items) {
echo "<li>$module:\n<ul>\n";
foreach($items as $item) {
@@ -68,11 +75,7 @@ foreach($entries as $module => $items) {
// encode HTML
$item = htmlspecialchars($item, ENT_NOQUOTES);
// convert bug numbers
- $item = preg_replace(
- array('/Fixed bug #([0-9]+)/', '/Fixed PECL bug
#([0-9]+)/', '/Implemented FR #([0-9]+)/', '/GitHub PR #([0-9]+)/'),
- array('<?php bugfix(\1); ?>', '<?php peclbugfix(\1);
?>', '<?php implemented(\1); ?>', '<?php githubissuel(\'php/php-src\',\1); ?>'),
- $item
- );
+ $item = preg_replace(array_keys($bug_map),
array_values($bug_map), $item);
echo " <li>$item</li>\n";
}
echo "</ul></li>\n";
--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php