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()->disable();
16 $filename = CHANGELOG_FILE
;
21 // Check if the file is available, some distributions remove these.
22 if (is_readable($filename)) {
24 // Test if the if is in a compressed format
25 if (substr($filename, -3) == '.gz') {
27 readgzfile($filename);
28 $changelog = ob_get_contents();
31 $changelog = file_get_contents($filename);
35 __('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'),
42 * Whole changelog in variable.
44 $changelog = htmlspecialchars($changelog);
46 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
47 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
48 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
49 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
50 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
53 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
54 => '<a href="\\1">\\1</a>',
57 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*)@users.sourceforge.net>/i'
58 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
59 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
60 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
61 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
62 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
65 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i'
66 => '\\1 <a href="mailto:\\3">\\2</a>',
69 '/patch\s*#?([0-9]{6,})/i'
70 => '<a href="' . $tracker_url . '">patch #\\1</a>',
73 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
74 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
77 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
78 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
81 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
82 => '<a href="http://docs.phpmyadmin.net/en/latest/faq.html#faq\\1-\\2">FAQ \\1.\\2</a>',
85 '/bug\s*#?([0-9]{6,})/i'
86 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
88 // all other 6+ digit numbers are treated as bugs
89 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
90 => '<a href="' . $tracker_url . '">bug #\\1</a>',
92 // transitioned SF.net project bug/rfe/patch links
93 // by the time we reach 6-digit numbers, we can probably retire the above links
94 '/patch\s*#?([0-9]{4,5}) /i'
95 => '<a href="' . $tracker_url_patch . '">patch #\\1</a> ',
96 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
97 => '<a href="' . $tracker_url_rfe . '">RFE #\\1</a> ',
98 '/bug\s*#?([0-9]{4,5}) /i'
99 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
100 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
101 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
104 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
105 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
108 '/(PMASA-[0-9]+-[0-9]+)/'
109 => '<a href="http://www.phpmyadmin.net/home_page/security/\\1.php">\\1</a>',
111 // Highlight releases (with links)
112 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
113 => '<a name="\\1_\\2_\\3"></a>'
114 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
115 . '\\1.\\2.\\3.0 \\4</a>',
116 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
117 => '<a name="\\1_\\2_\\3_\\4"></a>'
118 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
119 . '\\1.\\2.\\3.\\4 \\5</a>',
121 // Highlight releases (not linkable)
127 header('Content-type: text/html; charset=utf-8');
130 <html lang
="en" dir
="ltr">
132 <link rel
="icon" href
="favicon.ico" type
="image/x-icon" />
133 <link rel
="shortcut icon" href
="favicon.ico" type
="image/x-icon" />
134 <title
>phpMyAdmin
- ChangeLog
</title
>
135 <meta charset
="utf-8" />
138 <h1
>phpMyAdmin
- ChangeLog
</h1
>
141 echo preg_replace(array_keys($replaces), $replaces, $changelog);
144 <script type
="text/javascript">
145 var links
= document
.getElementsByTagName("a");
146 for(var i
= 0; i
< links
.length
; i++
) {
147 links
[i
].target
= "_blank";