Translated using Weblate (Japanese)
[phpmyadmin.git] / changelog.php
blobaec2e6c277afc0cb7921f8bbd7b96d8556693fab
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Simple script to set correct charset for changelog
6 * @package PhpMyAdmin
7 */
8 use PMA\libraries\Response;
10 /**
11 * Gets core libraries and defines some variables
13 require 'libraries/common.inc.php';
15 $response = Response::getInstance();
16 $response->disable();
17 $response->getHeader()->sendHttpHeaders();
19 $filename = CHANGELOG_FILE;
21 /**
22 * Read changelog.
24 // Check if the file is available, some distributions remove these.
25 if (@is_readable($filename)) {
27 // Test if the if is in a compressed format
28 if (substr($filename, -3) == '.gz') {
29 ob_start();
30 readgzfile($filename);
31 $changelog = ob_get_contents();
32 ob_end_clean();
33 } else {
34 $changelog = file_get_contents($filename);
36 } else {
37 printf(
38 __(
39 'The %s file is not available on this system, please visit ' .
40 '%s for more information.'
42 $filename,
43 '<a href="https://www.phpmyadmin.net/">phpmyadmin.net</a>'
45 exit;
48 /**
49 * Whole changelog in variable.
51 $changelog = htmlspecialchars($changelog);
53 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
54 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
55 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
56 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
57 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
58 $faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html';
60 $replaces = array(
61 '@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
62 => '<a href="url.php?url=\\1">\\1</a>',
64 // sourceforge users
65 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
66 => '\\1 <a href="url.php?url=https://sourceforge.net/users/\\3/">\\2</a>',
67 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
68 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
69 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
70 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
72 // mail address
73 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
74 => '\\1 <a href="mailto:\\3">\\2</a>',
76 // linking patches
77 '/patch\s*#?([0-9]{6,})/i'
78 => '<a href="url.php?url=' . $tracker_url . '">patch #\\1</a>',
80 // linking RFE
81 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
82 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
84 // FAQ entries
85 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
86 => '<a href="url.php?url=' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
88 // linking bugs
89 '/bug\s*#?([0-9]{6,})/i'
90 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
92 // all other 6+ digit numbers are treated as bugs
93 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
94 => '<a href="url.php?url=' . $tracker_url . '">bug #\\1</a>',
96 // GitHub issues
97 '/issue\s*#?([0-9]{4,5}) /i'
98 => '<a href="url.php?url=' . $github_url . 'issues/\\1">issue #\\1</a> ',
100 // transitioned SF.net project bug/rfe/patch links
101 // by the time we reach 6-digit numbers, we can probably retire the above links
102 '/patch\s*#?([0-9]{4,5}) /i'
103 => '<a href="url.php?url=' . $tracker_url_patch . '">patch #\\1</a> ',
104 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
105 => '<a href="url.php?url=' . $tracker_url_rfe . '">RFE #\\1</a> ',
106 '/bug\s*#?([0-9]{4,5}) /i'
107 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
108 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
109 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
111 // CVE/CAN entries
112 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
113 => '<a href="url.php?url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
115 // PMASAentries
116 '/(PMASA-[0-9]+-[0-9]+)/'
117 => '<a href="url.php?url=https://www.phpmyadmin.net/security/\\1/">\\1</a>',
119 // Highlight releases (with links)
120 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
121 => '<a name="\\1_\\2_\\3"></a>'
122 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
123 . '\\1.\\2.\\3.0 \\4</a>',
124 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
125 => '<a name="\\1_\\2_\\3_\\4"></a>'
126 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
127 . '\\1.\\2.\\3.\\4 \\5</a>',
129 // Highlight releases (not linkable)
130 '/( ### )(.*)/'
131 => '\\1<b>\\2</b>',
133 // Links target and rel
134 '/a href="/' => 'a target="_blank" rel="noopener noreferrer" href="'
138 header('Content-type: text/html; charset=utf-8');
140 <!DOCTYPE HTML>
141 <html lang="en" dir="ltr">
142 <head>
143 <link rel="icon" href="favicon.ico" type="image/x-icon" />
144 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
145 <title>phpMyAdmin - ChangeLog</title>
146 <meta charset="utf-8" />
147 </head>
148 <body>
149 <h1>phpMyAdmin - ChangeLog</h1>
150 <?php
151 echo '<pre>';
152 echo preg_replace(array_keys($replaces), $replaces, $changelog);
153 echo '</pre>';
155 </body>
156 </html>