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 '%s for more information.'
42 '<a href="https://www.phpmyadmin.net/">phpmyadmin.net</a>'
48 * Whole changelog in variable.
50 $changelog = htmlspecialchars($changelog);
52 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
53 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
54 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
55 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
56 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
57 $faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html';
60 '@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
61 => '<a href="url.php?url=\\1">\\1</a>',
64 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*)@users.sourceforge.net>/i'
65 => '\\1 <a href="url.php?url=https://sourceforge.net/users/\\3/">\\2</a>',
66 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
67 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
68 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
69 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
72 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i'
73 => '\\1 <a href="mailto:\\3">\\2</a>',
76 '/patch\s*#?([0-9]{6,})/i'
77 => '<a href="url.php?url=' . $tracker_url . '">patch #\\1</a>',
80 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
81 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
84 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
85 => '\\1<a href="url.php?url=' . $github_url . 'commits/HEAD/\\2">\\2</a>',
88 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
89 => '<a href="url.php?url=' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
92 '/bug\s*#?([0-9]{6,})/i'
93 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
95 // all other 6+ digit numbers are treated as bugs
96 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
97 => '<a href="url.php?url=' . $tracker_url . '">bug #\\1</a>',
100 '/issue\s*#?([0-9]{4,5}) /i'
101 => '<a href="url.php?url=' . $github_url . 'issues/\\1">issue #\\1</a> ',
103 // transitioned SF.net project bug/rfe/patch links
104 // by the time we reach 6-digit numbers, we can probably retire the above links
105 '/patch\s*#?([0-9]{4,5}) /i'
106 => '<a href="url.php?url=' . $tracker_url_patch . '">patch #\\1</a> ',
107 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
108 => '<a href="url.php?url=' . $tracker_url_rfe . '">RFE #\\1</a> ',
109 '/bug\s*#?([0-9]{4,5}) /i'
110 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
111 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
112 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
115 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
116 => '<a href="url.php?url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
119 '/(PMASA-[0-9]+-[0-9]+)/'
120 => '<a href="url.php?url=https://www.phpmyadmin.net/security/\\1/">\\1</a>',
122 // Highlight releases (with links)
123 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
124 => '<a name="\\1_\\2_\\3"></a>'
125 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
126 . '\\1.\\2.\\3.0 \\4</a>',
127 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
128 => '<a name="\\1_\\2_\\3_\\4"></a>'
129 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
130 . '\\1.\\2.\\3.\\4 \\5</a>',
132 // Highlight releases (not linkable)
138 header('Content-type: text/html; charset=utf-8');
141 <html lang
="en" dir
="ltr">
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" />
149 <h1
>phpMyAdmin
- ChangeLog
</h1
>
152 echo preg_replace(array_keys($replaces), $replaces, $changelog);
155 <script type
="text/javascript">
156 var links
= document
.getElementsByTagName("a");
157 for(var i
= 0; i
< links
.length
; i++
) {
158 links
[i
].target
= "_blank";
159 links
[i
].rel
= "noopener noreferrer";