• R/O
  • HTTP
  • SSH
  • HTTPS

pukiwiki: Commit


Commit MetaInfo

Revision5b6fcbbde6bc1392c84053e573786a33fccf06ec (tree)
Time2017-02-16 02:45:10
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/694 Stop reading page that is not readable as template

Change Summary

Incremental Difference

--- a/plugin/template.inc.php
+++ b/plugin/template.inc.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // template.inc.php
44 // Copyright
5-// 2002-2016 PukiWiki Development Team
5+// 2002-2017 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -22,8 +22,10 @@ function plugin_template_action()
2222 if (! isset($vars['refer']) || ! is_page($vars['refer']))
2323 return FALSE;
2424
25- $lines = get_source($vars['refer']);
26-
25+ $refer = $vars['refer'];
26+ // Ensure page is readable, or show Login UI and exit
27+ ensure_page_readable($refer);
28+ $lines = get_source($refer);
2729 // Remove '#freeze'
2830 if (! empty($lines) && strtolower(rtrim($lines[0])) == '#freeze')
2931 array_shift($lines);
@@ -43,6 +45,8 @@ function plugin_template_action()
4345
4446 // edit
4547 if ($is_pagename = is_pagename($page) && (! $is_page || ! empty($vars['force']))) {
48+ // Ensure page is readable, or show Login UI and exit
49+ ensure_page_writable($page);
4650 $postdata = join('', array_splice($lines, $begin, $end - $begin + 1));
4751 $retvar['msg'] = $_title_edit;
4852 $retvar['body'] = edit_form($vars['page'], $postdata);
Show on old repository browser