-
Notifications
You must be signed in to change notification settings - Fork 1
/
changelog.php
59 lines (52 loc) · 2.54 KB
/
changelog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Display changelog file with clickable bugs and RFEs
*
* Genmod: Genealogy Viewer
* Copyright (C) 2005 - 2012 Genmod Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @package Genmod
* @subpackage Admin
* @version $Id: changelog.php 29 2022-07-17 13:18:20Z Boudewijn $
*/
$search = @$HTTP_GET_VARS["search"];
if (empty($search)) $search = @$_GET["search"];
print "<title>Genmod : changelog ($search)</title>\n";
$text = file_get_contents("changelog.txt");
$wait = @file_get_contents("changelog.local.txt");
$text = $wait.$text;
// disable HTML tags
$text = preg_replace("/</", "<", $text);
$text = preg_replace("/>/", ">", $text);
// highlight search text (caseless)
if (!empty($search)) {
$text = preg_replace("/(.*)(?i)($search)(.*)\\n/", "<span style=\"background-color:#DADADA\">\\0</span>", $text);
$text = preg_replace("/(?i)$search/", "<span style=\"background-color:Yellow\">\\0</span>", $text);
}
// add link to tracker
$text = preg_replace("/RFE(\d{6,7})/", "RFE \\1", $text); // RFE1234567 ==> RFE 1234567
$text = preg_replace("/#(\d{6,7})/", "# \\1", $text); // #1234567 ==> # 1234567
$text = preg_replace("/\[(\d{6,7})/", "[ \\1", $text); // [1234567 ==> [ 1234567
$text = preg_replace("/(\d{6,7})\]/", "\\1 ]", $text); // 1234567] ==> 1234567 ]
$text = preg_replace("/\((\d{6,7})/", "( \\1", $text); // (1234567 ==> ( 1234567
$text = preg_replace("/(\d{6,7})\)/", "\\1 )", $text); // 1234567) ==> 1234567 )
$text = preg_replace("/(\d{6,7})\,/", "\\1 ,", $text); // 1234567, ==> 1234567 ,
$text = preg_replace("/ (\d{6,7}) /", " <a name=\\1 href=https://sourceforge.net/support/tracker.php?aid=\\1>\\1</a> ", $text);
$text = preg_replace("/ \(([-\w]{4,12})\)\r\n/", " (<a name=\\1 href=?search=\\1>\\1</a>)\r\n", $text);
$text = preg_replace("/ /", " ", $text);
print "<pre>\n$text\n</pre>\n";
?>