Translated using Weblate (Czech)
[phpmyadmin.git] / changelog.php
blob5066ffe03e82f72282d9eb6bfa4f1ac158447d78
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/';
52 $faq_url = 'http://docs.phpmyadmin.net/en/latest/faq.html';
54 $replaces = array(
55 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
56 => '<a href="\\1">\\1</a>',
58 // sourceforge users
59 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/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>',
66 // mail address
67 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
68 => '\\1 <a href="mailto:\\3">\\2</a>',
70 // linking patches
71 '/patch\s*#?([0-9]{6,})/i'
72 => '<a href="' . $tracker_url . '">patch #\\1</a>',
74 // linking RFE
75 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
76 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
78 // linking files
79 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
80 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
82 // FAQ entries
83 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
84 => '<a href="' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
86 // linking bugs
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> ',
105 // CVE/CAN entries
106 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
107 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
109 // PMASAentries
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)
124 '/( ### )(.*)/'
125 => '\\1<b>\\2</b>',
129 header('Content-type: text/html; charset=utf-8');
131 <!DOCTYPE HTML>
132 <html lang="en" dir="ltr">
133 <head>
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" />
138 </head>
139 <body>
140 <h1>phpMyAdmin - ChangeLog</h1>
141 <?php
142 echo '<pre>';
143 echo preg_replace(array_keys($replaces), $replaces, $changelog);
144 echo '</pre>';
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";
151 </script>
152 </body>
153 </html>