Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / changelog.php
blobc216c7fe3dd617feb9a62eedcc6da296d5962e46
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Simple script to set correct charset for changelog
6 * @package PhpMyAdmin
7 */
9 /**
10 * Gets core libraries and defines some variables
12 require 'libraries/common.inc.php';
14 $response = PMA_Response::getInstance();
15 $response->disable();
17 $filename = CHANGELOG_FILE;
19 /**
20 * Read changelog.
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') {
27 ob_start();
28 readgzfile($filename);
29 $changelog = ob_get_contents();
30 ob_end_clean();
31 } else {
32 $changelog = file_get_contents($filename);
34 } else {
35 printf(
36 __('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'),
37 $filename
39 exit;
42 /**
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/';
53 $replaces = array(
54 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
55 => '<a href="\\1">\\1</a>',
57 // sourceforge users
58 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
59 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
60 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
61 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
62 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
63 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
65 // mail address
66 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
67 => '\\1 <a href="mailto:\\3">\\2</a>',
69 // linking patches
70 '/patch\s*#?([0-9]{6,})/i'
71 => '<a href="' . $tracker_url . '">patch #\\1</a>',
73 // linking RFE
74 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
75 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
77 // linking files
78 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
79 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
81 // FAQ entries
82 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
83 => '<a href="http://docs.phpmyadmin.net/en/latest/faq.html#faq\\1-\\2">FAQ \\1.\\2</a>',
85 // linking bugs
86 '/bug\s*#?([0-9]{6,})/i'
87 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
89 // all other 6+ digit numbers are treated as bugs
90 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
91 => '<a href="' . $tracker_url . '">bug #\\1</a>',
93 // transitioned SF.net project bug/rfe/patch links
94 // by the time we reach 6-digit numbers, we can probably retire the above links
95 '/patch\s*#?([0-9]{4,5}) /i'
96 => '<a href="' . $tracker_url_patch . '">patch #\\1</a> ',
97 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
98 => '<a href="' . $tracker_url_rfe . '">RFE #\\1</a> ',
99 '/bug\s*#?([0-9]{4,5}) /i'
100 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
101 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
102 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
104 // CVE/CAN entries
105 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
106 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
108 // PMASAentries
109 '/(PMASA-[0-9]+-[0-9]+)/'
110 => '<a href="http://www.phpmyadmin.net/home_page/security/\\1.php">\\1</a>',
112 // Highlight releases (with links)
113 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
114 => '<a name="\\1_\\2_\\3"></a>'
115 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
116 . '\\1.\\2.\\3.0 \\4</a>',
117 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
118 => '<a name="\\1_\\2_\\3_\\4"></a>'
119 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
120 . '\\1.\\2.\\3.\\4 \\5</a>',
122 // Highlight releases (not linkable)
123 '/( ### )(.*)/'
124 => '\\1<b>\\2</b>',
128 header('Content-type: text/html; charset=utf-8');
130 <!DOCTYPE HTML>
131 <html lang="en" dir="ltr">
132 <head>
133 <link rel="icon" href="favicon.ico" type="image/x-icon" />
134 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
135 <title>phpMyAdmin - ChangeLog</title>
136 <meta charset="utf-8" />
137 </head>
138 <body>
139 <h1>phpMyAdmin - ChangeLog</h1>
140 <?php
141 echo '<pre>';
142 echo preg_replace(array_keys($replaces), $replaces, $changelog);
143 echo '</pre>';
145 <script type="text/javascript">
146 var links = document.getElementsByTagName("a");
147 for(var i = 0; i < links.length; i++) {
148 links[i].target = "_blank";
150 </script>
151 </body>
152 </html>