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_Response
::getInstance();
17 $filename = CHANGELOG_FILE
;
22 // Check if the file is available, some distributions remove these.
23 if (is_readable($filename)) {
25 // Test if the if is in a compressed format
26 if (substr($filename, -3) == '.gz') {
28 readgzfile($filename);
29 $changelog = ob_get_contents();
32 $changelog = file_get_contents($filename);
36 __('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'),
43 * Whole changelog in variable.
45 $changelog = htmlspecialchars($changelog);
47 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
48 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
49 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
50 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
51 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
52 $faq_url = 'http://docs.phpmyadmin.net/en/latest/faq.html';
55 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
56 => '<a href="\\1">\\1</a>',
59 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*)@users.sourceforge.net>/i'
60 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
61 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
62 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
63 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
64 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
67 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i'
68 => '\\1 <a href="mailto:\\3">\\2</a>',
71 '/patch\s*#?([0-9]{6,})/i'
72 => '<a href="' . $tracker_url . '">patch #\\1</a>',
75 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
76 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
79 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
80 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
83 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
84 => '<a href="' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
87 '/bug\s*#?([0-9]{6,})/i'
88 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
90 // all other 6+ digit numbers are treated as bugs
91 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
92 => '<a href="' . $tracker_url . '">bug #\\1</a>',
94 // transitioned SF.net project bug/rfe/patch links
95 // by the time we reach 6-digit numbers, we can probably retire the above links
96 '/patch\s*#?([0-9]{4,5}) /i'
97 => '<a href="' . $tracker_url_patch . '">patch #\\1</a> ',
98 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
99 => '<a href="' . $tracker_url_rfe . '">RFE #\\1</a> ',
100 '/bug\s*#?([0-9]{4,5}) /i'
101 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
102 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
103 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
106 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
107 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
110 '/(PMASA-[0-9]+-[0-9]+)/'
111 => '<a href="http://www.phpmyadmin.net/home_page/security/\\1.php">\\1</a>',
113 // Highlight releases (with links)
114 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
115 => '<a name="\\1_\\2_\\3"></a>'
116 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
117 . '\\1.\\2.\\3.0 \\4</a>',
118 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
119 => '<a name="\\1_\\2_\\3_\\4"></a>'
120 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
121 . '\\1.\\2.\\3.\\4 \\5</a>',
123 // Highlight releases (not linkable)
129 header('Content-type: text/html; charset=utf-8');
132 <html lang
="en" dir
="ltr">
134 <link rel
="icon" href
="favicon.ico" type
="image/x-icon" />
135 <link rel
="shortcut icon" href
="favicon.ico" type
="image/x-icon" />
136 <title
>phpMyAdmin
- ChangeLog
</title
>
137 <meta charset
="utf-8" />
140 <h1
>phpMyAdmin
- ChangeLog
</h1
>
143 echo preg_replace(array_keys($replaces), $replaces, $changelog);
146 <script type
="text/javascript">
147 var links
= document
.getElementsByTagName("a");
148 for(var i
= 0; i
< links
.length
; i++
) {
149 links
[i
].target
= "_blank";