リビジョン | 3618e79c684622da92c73d2150d5c4f9962783f7 (tree) |
---|---|
日時 | 2016-02-04 01:15:30 |
作者 | umorigu <umorigu@gmai...> |
コミッター | umorigu |
BugTrack2/374 Remove author info when the page is used as template
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: edit.inc.php,v 1.49 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) 2001-2007 PukiWiki Developers Team | |
3 | +// edit.inc.php | |
4 | +// Copyright (C) 2001-2016 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Edit plugin (cmd=edit) |
@@ -43,9 +43,7 @@ function plugin_edit_preview() | ||
43 | 43 | |
44 | 44 | // Loading template |
45 | 45 | if (isset($vars['template_page']) && is_page($vars['template_page'])) { |
46 | - | |
47 | - $vars['msg'] = join('', get_source($vars['template_page'])); | |
48 | - | |
46 | + $vars['msg'] = remove_author_info(get_source($vars['template_page'], TRUE, TRUE)); | |
49 | 47 | // Cut fixed anchors |
50 | 48 | $vars['msg'] = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/m', '$1$2', $vars['msg']); |
51 | 49 | } |
@@ -248,4 +246,3 @@ function plugin_edit_cancel() | ||
248 | 246 | header('Location: ' . get_script_uri() . '?' . pagename_urlencode($vars['page'])); |
249 | 247 | exit; |
250 | 248 | } |
251 | - |
@@ -1,5 +1,10 @@ | ||
1 | 1 | <?php |
2 | -// $Id: template.inc.php,v 1.22 2011/01/25 15:01:01 henoheno Exp $ | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone. | |
3 | +// template.inc.php | |
4 | +// Copyright | |
5 | +// 2002-2016 PukiWiki Development Team | |
6 | +// 2001-2002 Originally written by yu-ji | |
7 | +// License: GPL v2 or (at your option) any later version | |
3 | 8 | // |
4 | 9 | // Load template plugin |
5 | 10 |
@@ -22,6 +27,9 @@ function plugin_template_action() | ||
22 | 27 | // Remove '#freeze' |
23 | 28 | if (! empty($lines) && strtolower(rtrim($lines[0])) == '#freeze') |
24 | 29 | array_shift($lines); |
30 | + // Remove '#author' | |
31 | + if (! empty($lines) && preg_match('/^#author\(/', $lines[0])) | |
32 | + array_shift($lines); | |
25 | 33 | |
26 | 34 | $begin = (isset($vars['begin']) && is_numeric($vars['begin'])) ? $vars['begin'] : 0; |
27 | 35 | $end = (isset($vars['end']) && is_numeric($vars['end'])) ? $vars['end'] : count($lines) - 1; |
@@ -82,4 +90,3 @@ EOD; | ||
82 | 90 | |
83 | 91 | return $retvar; |
84 | 92 | } |
85 | -?> |