Translated using Weblate (Spanish)
[phpmyadmin.git] / changelog.php
blob9dc60b6a1a3ef3280225a5fe79f2d9f8b3e21de0
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()->disable();
16 $filename = CHANGELOG_FILE;
18 /**
19 * Read changelog.
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') {
26 ob_start();
27 readgzfile($filename);
28 $changelog = ob_get_contents();
29 ob_end_clean();
30 } else {
31 $changelog = file_get_contents($filename);
33 } else {
34 printf(
35 __('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'),
36 $filename
38 exit;
41 /**
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/';
52 $replaces = array(
53 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
54 => '<a href="\\1">\\1</a>',
56 // sourceforge users
57 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/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>',
64 // mail address
65 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
66 => '\\1 <a href="mailto:\\3">\\2</a>',
68 // linking patches
69 '/patch\s*#?([0-9]{6,})/i'
70 => '<a href="' . $tracker_url . '">patch #\\1</a>',
72 // linking RFE
73 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
74 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
76 // linking files
77 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
78 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
80 // FAQ entries
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>',
84 // linking bugs
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> ',
103 // CVE/CAN entries
104 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
105 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
107 // PMASAentries
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)
122 '/( ### )(.*)/'
123 => '\\1<b>\\2</b>',
127 header('Content-type: text/html; charset=utf-8');
129 <!DOCTYPE HTML>
130 <html lang="en" dir="ltr">
131 <head>
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" />
136 </head>
137 <body>
138 <h1>phpMyAdmin - ChangeLog</h1>
139 <?php
140 echo '<pre>';
141 echo preg_replace(array_keys($replaces), $replaces, $changelog);
142 echo '</pre>';
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";
149 </script>
150 </body>
151 </html>