2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Simple script to set correct charset for changelog
10 * Gets core libraries and defines some variables
12 require 'libraries/common.inc.php';
14 $response = PMA\libraries\Response
::getInstance();
16 $response->getHeader()->sendHttpHeaders();
18 $filename = CHANGELOG_FILE
;
23 // Check if the file is available, some distributions remove these.
24 if (@is_readable
($filename)) {
26 // Test if the if is in a compressed format
27 if (substr($filename, -3) == '.gz') {
29 readgzfile($filename);
30 $changelog = ob_get_contents();
33 $changelog = file_get_contents($filename);
38 'The %s file is not available on this system, please visit '
39 . 'www.phpmyadmin.net for more information.'
47 * Whole changelog in variable.
49 $changelog = htmlspecialchars($changelog);
51 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
52 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
53 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
54 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
55 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
56 $faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html';
59 '@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
60 => '<a href="url.php?url=\\1">\\1</a>',
63 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*)@users.sourceforge.net>/i'
64 => '\\1 <a href="url.php?url=https://sourceforge.net/users/\\3/">\\2</a>',
65 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
66 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
67 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
68 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
71 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i'
72 => '\\1 <a href="mailto:\\3">\\2</a>',
75 '/patch\s*#?([0-9]{6,})/i'
76 => '<a href="url.php?url=' . $tracker_url . '">patch #\\1</a>',
79 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
80 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
83 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
84 => '\\1<a href="url.php?url=' . $github_url . 'commits/HEAD/\\2">\\2</a>',
87 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
88 => '<a href="url.php?url=' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
91 '/bug\s*#?([0-9]{6,})/i'
92 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
94 // all other 6+ digit numbers are treated as bugs
95 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
96 => '<a href="url.php?url=' . $tracker_url . '">bug #\\1</a>',
99 '/issue\s*#?([0-9]{4,5}) /i'
100 => '<a href="url.php?url=' . $github_url . 'issues/\\1">issue #\\1</a> ',
102 // transitioned SF.net project bug/rfe/patch links
103 // by the time we reach 6-digit numbers, we can probably retire the above links
104 '/patch\s*#?([0-9]{4,5}) /i'
105 => '<a href="url.php?url=' . $tracker_url_patch . '">patch #\\1</a> ',
106 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
107 => '<a href="url.php?url=' . $tracker_url_rfe . '">RFE #\\1</a> ',
108 '/bug\s*#?([0-9]{4,5}) /i'
109 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
110 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
111 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
114 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
115 => '<a href="url.php?url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
118 '/(PMASA-[0-9]+-[0-9]+)/'
119 => '<a href="url.php?url=https://www.phpmyadmin.net/security/\\1/">\\1</a>',
121 // Highlight releases (with links)
122 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
123 => '<a name="\\1_\\2_\\3"></a>'
124 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
125 . '\\1.\\2.\\3.0 \\4</a>',
126 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
127 => '<a name="\\1_\\2_\\3_\\4"></a>'
128 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
129 . '\\1.\\2.\\3.\\4 \\5</a>',
131 // Highlight releases (not linkable)
137 header('Content-type: text/html; charset=utf-8');
140 <html lang
="en" dir
="ltr">
142 <link rel
="icon" href
="favicon.ico" type
="image/x-icon" />
143 <link rel
="shortcut icon" href
="favicon.ico" type
="image/x-icon" />
144 <title
>phpMyAdmin
- ChangeLog
</title
>
145 <meta charset
="utf-8" />
148 <h1
>phpMyAdmin
- ChangeLog
</h1
>
151 echo preg_replace(array_keys($replaces), $replaces, $changelog);
154 <script type
="text/javascript">
155 var links
= document
.getElementsByTagName("a");
156 for(var i
= 0; i
< links
.length
; i++
) {
157 links
[i
].target
= "_blank";
158 links
[i
].rel
= "noopener noreferrer";