Fixed export of tables with VIRTUAL columns
[phpmyadmin.git] / changelog.php
blob46a16df32563e17fb0b39fdad66a5fee035efc38
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 */
8 use PMA\libraries\Response;
10 /**
11 * Gets core libraries and defines some variables
13 require 'libraries/common.inc.php';
15 $response = Response::getInstance();
16 $response->disable();
17 $response->getHeader()->sendHttpHeaders();
19 $filename = CHANGELOG_FILE;
21 /**
22 * Read changelog.
24 // Check if the file is available, some distributions remove these.
25 if (@is_readable($filename)) {
27 // Test if the if is in a compressed format
28 if (substr($filename, -3) == '.gz') {
29 ob_start();
30 readgzfile($filename);
31 $changelog = ob_get_contents();
32 ob_end_clean();
33 } else {
34 $changelog = file_get_contents($filename);
36 } else {
37 printf(
38 __(
39 'The %s file is not available on this system, please visit ' .
40 '%s for more information.'
42 $filename,
43 '<a href="https://www.phpmyadmin.net/">phpmyadmin.net</a>'
45 exit;
48 /**
49 * Whole changelog in variable.
51 $changelog = htmlspecialchars($changelog);
53 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
54 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
55 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
56 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
57 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
58 $faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html';
60 $replaces = array(
61 '@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
62 => '<a href="url.php?url=\\1">\\1</a>',
64 // sourceforge users
65 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
66 => '\\1 <a href="url.php?url=https://sourceforge.net/users/\\3/">\\2</a>',
67 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
68 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
69 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
70 => 'thanks to <a href="url.php?url=https://sourceforge.net/users/\\2/">\\1</a>',
72 // mail address
73 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
74 => '\\1 <a href="mailto:\\3">\\2</a>',
76 // linking patches
77 '/patch\s*#?([0-9]{6,})/i'
78 => '<a href="url.php?url=' . $tracker_url . '">patch #\\1</a>',
80 // linking RFE
81 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
82 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
84 // linking files
85 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
86 => '\\1<a href="url.php?url=' . $github_url . 'commits/HEAD/\\2">\\2</a>',
88 // FAQ entries
89 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
90 => '<a href="url.php?url=' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
92 // linking bugs
93 '/bug\s*#?([0-9]{6,})/i'
94 => '<a href="url.php?url=https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
96 // all other 6+ digit numbers are treated as bugs
97 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
98 => '<a href="url.php?url=' . $tracker_url . '">bug #\\1</a>',
100 // GitHub issues
101 '/issue\s*#?([0-9]{4,5}) /i'
102 => '<a href="url.php?url=' . $github_url . 'issues/\\1">issue #\\1</a> ',
104 // transitioned SF.net project bug/rfe/patch links
105 // by the time we reach 6-digit numbers, we can probably retire the above links
106 '/patch\s*#?([0-9]{4,5}) /i'
107 => '<a href="url.php?url=' . $tracker_url_patch . '">patch #\\1</a> ',
108 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
109 => '<a href="url.php?url=' . $tracker_url_rfe . '">RFE #\\1</a> ',
110 '/bug\s*#?([0-9]{4,5}) /i'
111 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
112 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
113 => '<a href="url.php?url=' . $tracker_url_bug . '">bug #\\1</a> ',
115 // CVE/CAN entries
116 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
117 => '<a href="url.php?url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
119 // PMASAentries
120 '/(PMASA-[0-9]+-[0-9]+)/'
121 => '<a href="url.php?url=https://www.phpmyadmin.net/security/\\1/">\\1</a>',
123 // Highlight releases (with links)
124 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
125 => '<a name="\\1_\\2_\\3"></a>'
126 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
127 . '\\1.\\2.\\3.0 \\4</a>',
128 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
129 => '<a name="\\1_\\2_\\3_\\4"></a>'
130 . '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
131 . '\\1.\\2.\\3.\\4 \\5</a>',
133 // Highlight releases (not linkable)
134 '/( ### )(.*)/'
135 => '\\1<b>\\2</b>',
137 // Links target and rel
138 '/a href="/' => 'a target="_blank" rel="noopener noreferrer" href="'
142 header('Content-type: text/html; charset=utf-8');
144 <!DOCTYPE HTML>
145 <html lang="en" dir="ltr">
146 <head>
147 <link rel="icon" href="favicon.ico" type="image/x-icon" />
148 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
149 <title>phpMyAdmin - ChangeLog</title>
150 <meta charset="utf-8" />
151 </head>
152 <body>
153 <h1>phpMyAdmin - ChangeLog</h1>
154 <?php
155 echo '<pre>';
156 echo preg_replace(array_keys($replaces), $replaces, $changelog);
157 echo '</pre>';
159 </body>
160 </html>