Skip to content
Newer
Older
100644 126 lines (105 sloc) 3.81 KB
77d62c4 @nijel Add headers to ChangeLog display.
nijel authored
1 <?php
817e790 synced/fixed vim line
Sebastian Mendel authored
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
3 /**
4 * Simple script to set correct charset for changelog
5 *
e56949f @nijel Use package name PhpMyAdmin
nijel authored
6 * @package PhpMyAdmin
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
7 */
77d62c4 @nijel Add headers to ChangeLog display.
nijel authored
8
ebeb0c3 @nijel Adding @package, first part.
nijel authored
9 /**
035d002 @helmo PMASA-2011-1 fixes
helmo authored
10 * Gets core libraries and defines some variables
7503c9b @nijel Better support for vendor customisation (based on what Debian needs)
nijel authored
11 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
12 require 'libraries/common.inc.php';
035d002 @helmo PMASA-2011-1 fixes
helmo authored
13
14 $filename = CHANGELOG_FILE;
7503c9b @nijel Better support for vendor customisation (based on what Debian needs)
nijel authored
15
16 /**
17 * Read changelog.
18 */
035d002 @helmo PMASA-2011-1 fixes
helmo authored
19 // Check if the file is available, some distributions remove these.
20 if (is_readable($filename)) {
21
22 // Test if the if is in a compressed format
23 if (substr($filename, -3) == '.gz') {
24 ob_start();
25 readgzfile($filename);
26 $changelog = ob_get_contents();
27 ob_end_clean();
28 } else {
29 $changelog = file_get_contents($filename);
30 }
7503c9b @nijel Better support for vendor customisation (based on what Debian needs)
nijel authored
31 } else {
035d002 @helmo PMASA-2011-1 fixes
helmo authored
32 printf(__('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'), $filename);
33 exit;
7503c9b @nijel Better support for vendor customisation (based on what Debian needs)
nijel authored
34 }
35
36 /**
ebeb0c3 @nijel Adding @package, first part.
nijel authored
37 * Whole changelog in variable.
38 */
7503c9b @nijel Better support for vendor customisation (based on what Debian needs)
nijel authored
39 $changelog = htmlspecialchars($changelog);
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
40
41 $replaces = array(
2edd655 @lem9 patch #2709040 [doc] Wrong link in ChangeLog formatter
lem9 authored
42 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
aad17c3 @nijel make URLs clickable
nijel authored
43 => '<a href="\\1">\\1</a>',
44
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
45 // sourceforge users
ca1026a @nijel fix email links
nijel authored
46 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
47 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
48 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
49 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
50 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
51 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
52
53 // mail adresse
ca1026a @nijel fix email links
nijel authored
54 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
55 => '\\1 <a href="mailto:\\3">\\2</a>',
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
56
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
57 // linking patches
58 '/patch\s*#?([0-9]{6,})/i'
b2fa83b use a more generic link for sf.net tracker items
Sebastian Mendel authored
59 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">patch #\\1</a>',
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
60
61 // linking RFE
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
62 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
b2fa83b use a more generic link for sf.net tracker items
Sebastian Mendel authored
63 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
64
65 // linking files
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
66 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
fcadb7a @madhuracj Entries in changelog should not point to GitHub
madhuracj authored
67 => '\\1<a href="https://github.com/phpmyadmin/phpmyadmin/commits/HEAD/\\2">\\2</a>',
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
68
69 // FAQ entries
70 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
71 => '<a href="http://localhost/phpMyAdmin/Documentation.html#faq\\1_\\2">FAQ \\1.\\2</a>',
72
73 // linking bugs
74 '/bug\s*#?([0-9]{6,})/i'
b2fa83b use a more generic link for sf.net tracker items
Sebastian Mendel authored
75 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
76
77 // all other 6+ digit numbers are treated as bugs
38e5f64 @nijel Lowercase to not trigger todo item in jenkins
nijel authored
78 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
b2fa83b use a more generic link for sf.net tracker items
Sebastian Mendel authored
79 => ' <a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
594d330 link also js, html, pl, and sh files, FAQ entries and contributors to…
Sebastian Mendel authored
80
8e32b42 @nijel Link to CAN/CVE security issues.
nijel authored
81 // CVE/CAN entries
82 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
83 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
84
b7d4ed8 @nijel Create links for security announcements
nijel authored
85 // PMASAentries
86 '/(PMASA-[0-9]+-[0-9]+)/'
87 => '<a href="http://www.phpmyadmin.net/home_page/security/\\1.php">\\1</a>',
88
1ac36fe @nijel link releases to tags in CVS
nijel authored
89 // Highlight releases (with links)
786361c @nijel Adjust links to releases in changelog.
nijel authored
90 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
fcadb7a @madhuracj Entries in changelog should not point to GitHub
madhuracj authored
91 => '<a name="\\1_\\2_\\3"></a><a href="https://github.com/phpmyadmin/phpmyadmin/commits/RELEASE_\\1_\\2_\\3">\\1.\\2.\\3.0 \\4</a>',
786361c @nijel Adjust links to releases in changelog.
nijel authored
92 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
fcadb7a @madhuracj Entries in changelog should not point to GitHub
madhuracj authored
93 => '<a name="\\1_\\2_\\3_\\4"></a><a href="https://github.com/phpmyadmin/phpmyadmin/commits/RELEASE_\\1_\\2_\\3_\\4">\\1.\\2.\\3.\\4 \\5</a>',
c8d47ae replaced php short open tag
Sebastian Mendel authored
94
1ac36fe @nijel link releases to tags in CVS
nijel authored
95 // Highlight releases (not linkable)
9694784 @nijel highlight releases
nijel authored
96 '/( ### )(.*)/'
97 => '\\1<b>\\2</b>',
98
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
99 );
100
101 header('Content-type: text/html; charset=utf-8');
adf542f @nijel Generate proper XHTML.
nijel authored
102 ?>
af0e6c7 Use HTML5 DOCTYPE along with new charset meta-tag
Jo Michael authored
103 <!DOCTYPE HTML>
653f086 Replaced xml:lang attributes by lang for HTML5
Jo Michael authored
104 <html lang="en" dir="ltr">
adf542f @nijel Generate proper XHTML.
nijel authored
105 <head>
af0e6c7 Use HTML5 DOCTYPE along with new charset meta-tag
Jo Michael authored
106 <link rel="icon" href="favicon.ico" type="image/x-icon" />
107 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
108 <title>phpMyAdmin - ChangeLog</title>
109 <meta charset="utf-8" />
adf542f @nijel Generate proper XHTML.
nijel authored
110 </head>
111 <body>
112 <h1>phpMyAdmin - ChangeLog</h1>
c8d47ae replaced php short open tag
Sebastian Mendel authored
113 <?php
5aa016d link users, files, bugs, rfes and patches
Sebastian Mendel authored
114 echo '<pre>';
115 echo preg_replace(array_keys($replaces), $replaces, $changelog);
116 echo '</pre>';
77d62c4 @nijel Add headers to ChangeLog display.
nijel authored
117 ?>
8dc4e35 Open links from changelog in new tab
Jo Michael authored
118 <script type="text/javascript">
119 var links = document.getElementsByTagName("a");
120 for(var i = 0; i < links.length; i++) {
121 links[i].target = "_blank";
122 }
123 </script>
adf542f @nijel Generate proper XHTML.
nijel authored
124 </body>
125 </html>
Something went wrong with that request. Please try again.