コミットメタ情報

リビジョン3618e79c684622da92c73d2150d5c4f9962783f7 (tree)
日時2016-02-04 01:15:30
作者umorigu <umorigu@gmai...>
コミッターumorigu

ログメッセージ

BugTrack2/374 Remove author info when the page is used as template

変更サマリ

差分

--- a/plugin/edit.inc.php
+++ b/plugin/edit.inc.php
@@ -1,7 +1,7 @@
11 <?php
22 // 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
55 // License: GPL v2 or (at your option) any later version
66 //
77 // Edit plugin (cmd=edit)
@@ -43,9 +43,7 @@ function plugin_edit_preview()
4343
4444 // Loading template
4545 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));
4947 // Cut fixed anchors
5048 $vars['msg'] = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/m', '$1$2', $vars['msg']);
5149 }
@@ -248,4 +246,3 @@ function plugin_edit_cancel()
248246 header('Location: ' . get_script_uri() . '?' . pagename_urlencode($vars['page']));
249247 exit;
250248 }
251-
--- a/plugin/template.inc.php
+++ b/plugin/template.inc.php
@@ -1,5 +1,10 @@
11 <?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
38 //
49 // Load template plugin
510
@@ -22,6 +27,9 @@ function plugin_template_action()
2227 // Remove '#freeze'
2328 if (! empty($lines) && strtolower(rtrim($lines[0])) == '#freeze')
2429 array_shift($lines);
30+ // Remove '#author'
31+ if (! empty($lines) && preg_match('/^#author\(/', $lines[0]))
32+ array_shift($lines);
2533
2634 $begin = (isset($vars['begin']) && is_numeric($vars['begin'])) ? $vars['begin'] : 0;
2735 $end = (isset($vars['end']) && is_numeric($vars['end'])) ? $vars['end'] : count($lines) - 1;
@@ -82,4 +90,3 @@ EOD;
8290
8391 return $retvar;
8492 }
85-?>
旧リポジトリブラウザで表示