]> src.bluestatic.org Git - viewsvn.git/blob - log.php
Sanitize the browse.php message
[viewsvn.git] / log.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 $fetchtemplates = array(
23 'log_node',
24 'log'
25 );
26
27 require_once('./global.php');
28
29 $navbar = $viewsvn->paths->construct_breadcrumb($path, false);
30
31 // ###################################################################
32
33 // this is NOT supposed to allow for revision ranges
34 $logs = new SVNLog($repos, $relpath, 0, $viewsvn->svn->common->fetch_head_rev($path));
35
36 $isdir = $viewsvn->svn->common->isdir($path);
37
38 $nodes = '';
39
40 foreach ($logs->fetch() AS $log)
41 {
42 $prev = $viewsvn->svn->common->fetch_prev_rev($path, $log['rev']);
43
44 $link['view'] = (!$isdir ? $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $log['rev']), $path) : '');
45 $link['blame'] = $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(false, $log['rev']), $path);
46
47 $show['diffhead'] = $viewsvn->svn->common->fetch_head_rev($path) != $log['rev'];
48 if ($show['diffhead'])
49 {
50 $link['diffhead'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $log['rev']), $path);
51 }
52
53 $show['diffprev'] = $prev != -1;
54 if ($show['diffprev'])
55 {
56 $link['diffprev'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $log['rev'], $prev), $path);
57 }
58
59 $log['message_clean'] = nl2br(htmlspecialchars($log['message']));
60
61 eval('$nodes .= "' . $template->fetch('log_node') . '";');
62 }
63
64 // ###################################################################
65
66 eval('$template->flush("' . $template->fetch('log') . '");');
67
68 /*=====================================================================*\
69 || ###################################################################
70 || # $HeadURL$
71 || # $Id$
72 || ###################################################################
73 \*=====================================================================*/
74 ?>