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();
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);
37 'The %s file is not available on this system, please visit '
38 . 'www.phpmyadmin.net for more information.'
46 * Whole changelog in variable.
48 $changelog = htmlspecialchars($changelog);
50 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
51 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
52 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
53 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
54 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
55 $faq_url = 'http://docs.phpmyadmin.net/en/latest/faq.html';
58 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
59 => '<a href="\\1">\\1</a>',
62 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*)@users.sourceforge.net>/i'
63 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
64 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
65 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
66 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
67 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
70 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i'
71 => '\\1 <a href="mailto:\\3">\\2</a>',
74 '/patch\s*#?([0-9]{6,})/i'
75 => '<a href="' . $tracker_url . '">patch #\\1</a>',
78 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
79 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
82 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
83 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
86 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
87 => '<a href="' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
90 '/bug\s*#?([0-9]{6,})/i'
91 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
93 // all other 6+ digit numbers are treated as bugs
94 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
95 => '<a href="' . $tracker_url . '">bug #\\1</a>',
98 '/issue\s*#?([0-9]{4,5}) /i'
99 => '<a href="' . $github_url . 'issues/\\1">issue #\\1</a> ',
101 // transitioned SF.net project bug/rfe/patch links
102 // by the time we reach 6-digit numbers, we can probably retire the above links
103 '/patch\s*#?([0-9]{4,5}) /i'
104 => '<a href="' . $tracker_url_patch . '">patch #\\1</a> ',
105 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
106 => '<a href="' . $tracker_url_rfe . '">RFE #\\1</a> ',
107 '/bug\s*#?([0-9]{4,5}) /i'
108 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
109 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
110 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
113 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
114 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
117 '/(PMASA-[0-9]+-[0-9]+)/'
118 => '<a href="https://www.phpmyadmin.net/security/\\1/">\\1</a>',
120 // Highlight releases (with links)
121 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
122 => '<a name="\\1_\\2_\\3"></a>'
123 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
124 . '\\1.\\2.\\3.0 \\4</a>',
125 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
126 => '<a name="\\1_\\2_\\3_\\4"></a>'
127 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
128 . '\\1.\\2.\\3.\\4 \\5</a>',
130 // Highlight releases (not linkable)
136 header('Content-type: text/html; charset=utf-8');
139 <html lang
="en" dir
="ltr">
141 <link rel
="icon" href
="favicon.ico" type
="image/x-icon" />
142 <link rel
="shortcut icon" href
="favicon.ico" type
="image/x-icon" />
143 <title
>phpMyAdmin
- ChangeLog
</title
>
144 <meta charset
="utf-8" />
147 <h1
>phpMyAdmin
- ChangeLog
</h1
>
150 echo preg_replace(array_keys($replaces), $replaces, $changelog);
153 <script type
="text/javascript">
154 var links
= document
.getElementsByTagName("a");
155 for(var i
= 0; i
< links
.length
; i++
) {
156 links
[i
].target
= "_blank";