Translated using Weblate (Spanish)
[phpmyadmin.git] / changelog.php
blob66edef1142d570573e0ffbf6811ec3fa7ac0a860
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 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
49 $replaces = array(
50 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
51 => '<a href="\\1">\\1</a>',
53 // sourceforge users
54 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
55 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
56 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
57 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
58 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
59 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
61 // mail adresse
62 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
63 => '\\1 <a href="mailto:\\3">\\2</a>',
65 // linking patches
66 '/patch\s*#?([0-9]{6,})/i'
67 => '<a href="' . $tracker_url . '">patch #\\1</a>',
69 // linking RFE
70 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
71 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
73 // linking files
74 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
75 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
77 // FAQ entries
78 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
79 => '<a href="https://docs.phpmyadmin.net/en/latest/faq.html#faq\\1-\\2">FAQ \\1.\\2</a>',
81 // linking bugs
82 '/bug\s*#?([0-9]{6,})/i'
83 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
85 // all other 6+ digit numbers are treated as bugs
86 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
87 => '<a href="' . $tracker_url . '">bug #\\1</a>',
89 // CVE/CAN entries
90 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
91 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
93 // PMASAentries
94 '/(PMASA-[0-9]+-[0-9]+)/'
95 => '<a href="http://www.phpmyadmin.net/home_page/security/\\1.php">\\1</a>',
97 // Highlight releases (with links)
98 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
99 => '<a name="\\1_\\2_\\3"></a>'
100 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
101 . '\\1.\\2.\\3.0 \\4</a>',
102 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
103 => '<a name="\\1_\\2_\\3_\\4"></a>'
104 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
105 . '\\1.\\2.\\3.\\4 \\5</a>',
107 // Highlight releases (not linkable)
108 '/( ### )(.*)/'
109 => '\\1<b>\\2</b>',
113 header('Content-type: text/html; charset=utf-8');
115 <!DOCTYPE HTML>
116 <html lang="en" dir="ltr">
117 <head>
118 <link rel="icon" href="favicon.ico" type="image/x-icon" />
119 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
120 <title>phpMyAdmin - ChangeLog</title>
121 <meta charset="utf-8" />
122 </head>
123 <body>
124 <h1>phpMyAdmin - ChangeLog</h1>
125 <?php
126 echo '<pre>';
127 echo preg_replace(array_keys($replaces), $replaces, $changelog);
128 echo '</pre>';
130 <script type="text/javascript">
131 var links = document.getElementsByTagName("a");
132 for(var i = 0; i < links.length; i++) {
133 links[i].target = "_blank";
135 </script>
136 </body>
137 </html>