Translated using Weblate (German)
[phpmyadmin.git] / changelog.php
blobc5a9d68b434f07f0a2a29a99b17f35a4eb4b43e2
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 // GitHub issues
95 '/issue\s*#?([0-9]{4,5}) /i'
96 => '<a href="' . $github_url . 'issues/\\1">issue #\\1</a> ',
98 // transitioned SF.net project bug/rfe/patch links
99 // by the time we reach 6-digit numbers, we can probably retire the above links
100 '/patch\s*#?([0-9]{4,5}) /i'
101 => '<a href="' . $tracker_url_patch . '">patch #\\1</a> ',
102 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
103 => '<a href="' . $tracker_url_rfe . '">RFE #\\1</a> ',
104 '/bug\s*#?([0-9]{4,5}) /i'
105 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
106 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
107 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
109 // CVE/CAN entries
110 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
111 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
113 // PMASAentries
114 '/(PMASA-[0-9]+-[0-9]+)/'
115 => '<a href="https://www.phpmyadmin.net/security/\\1/">\\1</a>',
117 // Highlight releases (with links)
118 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
119 => '<a name="\\1_\\2_\\3"></a>'
120 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
121 . '\\1.\\2.\\3.0 \\4</a>',
122 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
123 => '<a name="\\1_\\2_\\3_\\4"></a>'
124 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
125 . '\\1.\\2.\\3.\\4 \\5</a>',
127 // Highlight releases (not linkable)
128 '/( ### )(.*)/'
129 => '\\1<b>\\2</b>',
133 header('Content-type: text/html; charset=utf-8');
135 <!DOCTYPE HTML>
136 <html lang="en" dir="ltr">
137 <head>
138 <link rel="icon" href="favicon.ico" type="image/x-icon" />
139 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
140 <title>phpMyAdmin - ChangeLog</title>
141 <meta charset="utf-8" />
142 </head>
143 <body>
144 <h1>phpMyAdmin - ChangeLog</h1>
145 <?php
146 echo '<pre>';
147 echo preg_replace(array_keys($replaces), $replaces, $changelog);
148 echo '</pre>';
150 <script type="text/javascript">
151 var links = document.getElementsByTagName("a");
152 for(var i = 0; i < links.length; i++) {
153 links[i].target = "_blank";
155 </script>
156 </body>
157 </html>