OSDN Git Service

BugTrack/2176 showrss: Fix character encoding issues etc.
[pukiwiki/pukiwiki.git] / plugin / source.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone
3 // $Id: source.inc.php,v 1.16 2011/01/25 15:01:01 henoheno Exp $
4 //
5 // Source plugin
6
7 // Output source text of the page
8 function plugin_source_action()
9 {
10         global $vars, $_source_messages;
11
12         if (PKWK_SAFE_MODE) die_message('PKWK_SAFE_MODE prohibits this');
13
14         $page = isset($vars['page']) ? $vars['page'] : '';
15         $vars['refer'] = $page;
16
17         if (! is_page($page) || ! check_readable($page, false, false))
18                 return array('msg' => $_source_messages['msg_notfound'],
19                         'body' => $_source_messages['err_notfound']);
20
21         return array('msg' => $_source_messages['msg_title'],
22                 'body' => '<pre id="source">' .
23                 htmlsc(join('', get_source($page))) . '</pre>');
24 }
25 ?>