Translated using Weblate (Slovenian)
[phpmyadmin.git] / changelog.php
blob7cdc6759fa24aa3262c0b2f0d0e1c0064ee8ef65
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 __(
37 'The %s file is not available on this system, please visit '
38 . 'www.phpmyadmin.net for more information.'
40 $filename
42 exit;
45 /**
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';
57 $replaces = array(
58 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
59 => '<a href="\\1">\\1</a>',
61 // sourceforge users
62 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/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>',
69 // mail address
70 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
71 => '\\1 <a href="mailto:\\3">\\2</a>',
73 // linking patches
74 '/patch\s*#?([0-9]{6,})/i'
75 => '<a href="' . $tracker_url . '">patch #\\1</a>',
77 // linking RFE
78 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
79 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
81 // linking files
82 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
83 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
85 // FAQ entries
86 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
87 => '<a href="' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
89 // linking bugs
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>',
97 // transitioned SF.net project bug/rfe/patch links
98 // by the time we reach 6-digit numbers, we can probably retire the above links
99 '/patch\s*#?([0-9]{4,5}) /i'
100 => '<a href="' . $tracker_url_patch . '">patch #\\1</a> ',
101 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
102 => '<a href="' . $tracker_url_rfe . '">RFE #\\1</a> ',
103 '/bug\s*#?([0-9]{4,5}) /i'
104 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
105 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
106 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
108 // CVE/CAN entries
109 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
110 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
112 // PMASAentries
113 '/(PMASA-[0-9]+-[0-9]+)/'
114 => '<a href="http://www.phpmyadmin.net/home_page/security/\\1.php">\\1</a>',
116 // Highlight releases (with links)
117 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
118 => '<a name="\\1_\\2_\\3"></a>'
119 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
120 . '\\1.\\2.\\3.0 \\4</a>',
121 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
122 => '<a name="\\1_\\2_\\3_\\4"></a>'
123 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
124 . '\\1.\\2.\\3.\\4 \\5</a>',
126 // Highlight releases (not linkable)
127 '/( ### )(.*)/'
128 => '\\1<b>\\2</b>',
132 header('Content-type: text/html; charset=utf-8');
134 <!DOCTYPE HTML>
135 <html lang="en" dir="ltr">
136 <head>
137 <link rel="icon" href="favicon.ico" type="image/x-icon" />
138 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
139 <title>phpMyAdmin - ChangeLog</title>
140 <meta charset="utf-8" />
141 </head>
142 <body>
143 <h1>phpMyAdmin - ChangeLog</h1>
144 <?php
145 echo '<pre>';
146 echo preg_replace(array_keys($replaces), $replaces, $changelog);
147 echo '</pre>';
149 <script type="text/javascript">
150 var links = document.getElementsByTagName("a");
151 for(var i = 0; i < links.length; i++) {
152 links[i].target = "_blank";
154 </script>
155 </body>
156 </html>