/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: auth.php,v 1.3 2004/10/07 13:25:41 henoheno Exp $
+// $Id: auth.php,v 1.4 2004/12/02 11:42:37 henoheno Exp $
//
// ÊÔ½¸ÉÔ²Äǽ¤Ê¥Ú¡¼¥¸¤òÊÔ½¸¤·¤è¤¦¤È¤·¤¿¤È¤
|| $auth_users[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW'])
{
if ($auth_flag) {
+ pkwk_headers_sent();
header('WWW-Authenticate: Basic realm="'.$_msg_auth.'"');
header('HTTP/1.0 401 Unauthorized');
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: file.php,v 1.7 2004/11/23 01:58:53 henoheno Exp $
+// $Id: file.php,v 1.8 2004/12/02 11:42:37 henoheno Exp $
//
// ¥½¡¼¥¹¤ò¼èÆÀ
{
global $lastmod;
- if ($lastmod && is_page($page))
+ if ($lastmod && is_page($page)) {
+ pkwk_headers_sent();
header('Last-Modified: ' .
date('D, d M Y H:i:s', get_filetime($page)) . ' GMT');
+ }
}
// Á´¥Ú¡¼¥¸Ì¾¤òÇÛÎó¤Ë
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: func.php,v 1.13 2004/11/23 14:00:11 henoheno Exp $
+// $Id: func.php,v 1.14 2004/12/02 11:42:37 henoheno Exp $
//
// ʸ»úÎó¤¬InterWikiName¤«¤É¤¦¤«
if(defined('SKIN_FILE') && file_exists(SKIN_FILE) && is_readable(SKIN_FILE)) {
catbody($title, $page, $body);
} else {
+ pkwk_headers_sent();
header('Content-Type: text/html; charset=euc-jp');
print <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: html.php,v 1.16 2004/11/28 14:29:48 henoheno Exp $
+// $Id: html.php,v 1.17 2004/12/02 11:28:56 henoheno Exp $
//
// ËÜʸ¤ò½ÐÎÏ
return array ($s_page, $anchor, FALSE);
}
}
+
+// Check header()s were sent already, or
+// there're blank lines or something out of php blocks
+function pkwk_headers_sent()
+{
+ if(PKWK_OPTIMISE) return;
+
+ // PHP_VERSION >= 4.3.0
+ if(version_compare(PHP_VERSION, '4.3.0', '>=')) {
+ if (headers_sent($_file_sent, $_line_sent)) {
+ print('Headers already sent at ' .
+ htmlspecialchars($_file_sent) .
+ ' line ' . $_line_sent . '.');
+ exit;
+ }
+ } else {
+ if (headers_sent()) {
+ print('Headers already sent.');
+ exit;
+ }
+ }
+}
?>
//
/////////////////////////////////////////////////
-// $Id: amazon.inc.php,v 1.3 2004/10/10 10:20:59 henoheno Exp $
+// $Id: amazon.inc.php,v 1.4 2004/12/02 11:34:25 henoheno Exp $
// - modified by arino <arino@users.sourceforge.jp>
// -- replace plugin_amazon_get_page().
// -- AMAZON_XML 'xml.amazon.com' -> 'xml.amazon.co.jp'
$r_page = $s_page . '/' . $asin;
$r_page_url = rawurlencode($r_page);
+ pkwk_headers_sent();
if ($edit_auth and (!isset($_SERVER['PHP_AUTH_USER']) or !array_key_exists($_SERVER['PHP_AUTH_USER'],$edit_auth_users) or
$edit_auth_users[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW'])) {
header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page_url);
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: attach.inc.php,v 1.65 2004/11/27 11:02:34 henoheno Exp $
+// $Id: attach.inc.php,v 1.66 2004/12/02 11:34:25 henoheno Exp $
//
/*
ini_set('default_charset', '');
mb_http_output('pass');
+ pkwk_headers_sent();
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Length: ' . $this->size);
header('Content-Type: ' . $this->type);
* Êѹ¹ÍúÎò:
* 2002.06.17: ºî¤ê»Ï¤á
*
- * $Id: bugtrack.inc.php,v 1.17 2004/10/10 10:20:59 henoheno Exp $
+ * $Id: bugtrack.inc.php,v 1.18 2004/12/02 11:34:25 henoheno Exp $
*/
function plugin_bugtrack_init()
if ($post['mode'] == 'submit') {
$page = plugin_bugtrack_write($post['base'], $post['pagename'], $post['summary'], $post['name'], $post['priority'], $post['state'], $post['category'], $post['version'], $post['body']);
+ pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurlencode($page));
die;
}
<?php
/////////////////////////////////////////////////
-// $Id: dump.inc.php,v 1.31 2004/10/31 07:55:24 henoheno Exp $
+// $Id: dump.inc.php,v 1.32 2004/12/02 11:34:25 henoheno Exp $
// Originated as tarfile.inc.php by teanan / Interfair Laboratory 2004.
// [¹¹¿·ÍúÎò]
$filename .= '.tar';
}
+ pkwk_headers_sent();
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Length: ' . $size);
header('Content-Type: application/octet-stream');
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: edit.inc.php,v 1.27 2004/11/24 12:29:21 henoheno Exp $
+// $Id: edit.inc.php,v 1.28 2004/12/02 11:36:52 henoheno Exp $
//
// Edit plugin
page_write($page, $postdata, $notimestamp);
if ($postdata) {
+ pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurlencode($page));
exit;
}
function plugin_edit_cancel()
{
global $vars;
+ pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurlencode($vars['page']));
exit;
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: interwiki.inc.php,v 1.7 2004/07/31 03:09:20 henoheno Exp $
+// $Id: interwiki.inc.php,v 1.8 2004/12/02 11:35:02 henoheno Exp $
//
// InterWikiName¤ÎȽÊ̤ȥڡ¼¥¸¤Îɽ¼¨
return $retvars;
}
+ pkwk_headers_sent();
header("Location: $url");
die();
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: lookup.inc.php,v 1.12 2004/11/23 09:16:32 henoheno Exp $
+// $Id: lookup.inc.php,v 1.13 2004/12/02 11:34:25 henoheno Exp $
//
// Lookup plugin
return array(msg=>'Not found', body=>$msg);
}
+ pkwk_headers_sent();
header('Location: ' . $url); // Publish as GET method
die();
}
<?php
-// $Id: newpage.inc.php,v 1.10 2004/10/10 10:20:59 henoheno Exp $
+// $Id: newpage.inc.php,v 1.11 2004/12/02 11:39:08 henoheno Exp $
function plugin_newpage_convert()
{
get_fullname($page,$vars['refer']) : $page);
$r_refer = rawurlencode($vars['refer']);
+ pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page . '&refer=' . $r_refer);
die();
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: pcomment.inc.php,v 1.34 2004/10/10 10:20:59 henoheno Exp $
+// $Id: pcomment.inc.php,v 1.35 2004/12/02 11:34:25 henoheno Exp $
//
/*
return $retval;
}
+ pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurlencode($refer));
exit;
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: ref.inc.php,v 1.45 2004/11/27 11:02:34 henoheno Exp $
+// $Id: ref.inc.php,v 1.46 2004/12/02 11:34:25 henoheno Exp $
//
// Include an attached image-file as an inline-image
$size = filesize($ref);
// Output
+ pkwk_headers_sent();
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Length: ' . $size);
header('Content-Type: ' . $type);
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: rename.inc.php,v 1.16 2004/10/10 10:20:59 henoheno Exp $
+// $Id: rename.inc.php,v 1.17 2004/12/02 11:37:53 henoheno Exp $
//
/*
{
$page = RENAME_LOGPAGE;
}
+
+ pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurlencode($page));
die();
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: rss.inc.php,v 1.10 2004/11/28 04:23:13 henoheno Exp $
+// $Id: rss.inc.php,v 1.11 2004/12/02 11:34:25 henoheno Exp $
//
// Publishing RSS feed of RecentChanges
// HOW TO USE: rss.inc.php?ver=[0.91(default)|1.0|2.0]
}
// Feeding start
+ pkwk_headers_sent();
header('Content-type: application/xml');
print '<?xml version="1.0" encoding="UTF-8"?>' . "\n\n";
<?php
// RSS 1.0 plugin - had been merged into rss plugin
-// $Id: rss10.inc.php,v 1.15 2004/11/28 12:50:13 henoheno Exp $
+// $Id: rss10.inc.php,v 1.16 2004/12/02 11:34:25 henoheno Exp $
function plugin_rss10_action()
{
+ pkwk_headers_sent();
header('Status: 301 Moved Permanently');
header('Location: ' . $script . '?cmd=rss&ver=1.0'); // HTTP
exit;
<?php
-// $Id: tb.inc.php,v 1.13 2004/07/31 13:41:20 henoheno Exp $
+// $Id: tb.inc.php,v 1.14 2004/12/02 11:34:25 henoheno Exp $
/*
* PukiWiki TrackBack ¥×¥í¥°¥é¥à
* (C) 2003, Katsumi Saito <katsumi@jo1upk.ymt.prug.or.jp>
// XML ·ë²Ì½ÐÎÏ
function tb_xml_msg($rc, $msg)
{
+ pkwk_headers_sent();
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
echo <<<EOD
</response>
EOD;
$rc = mb_convert_encoding($rc, 'UTF-8', SOURCE_ENCODING);
+
+ pkwk_headers_sent();
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="utf-8" ?>';
echo $rc;
</html>
EOD;
// BugTrack/466 ¥¨¥ó¥³¡¼¥É¸íǧÂкö
+ pkwk_headers_sent();
header('Content-type: text/html; charset=UTF-8');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo mb_convert_encoding($msg, 'UTF-8', SOURCE_ENCODING);
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: touchgraph.inc.php,v 1.4 2004/07/31 03:09:20 henoheno Exp $
+// $Id: touchgraph.inc.php,v 1.5 2004/12/02 11:34:25 henoheno Exp $
//
// TouchGraph WikiBrowserÍѤΥ¤¥ó¥Ç¥Ã¥¯¥¹¤òºî¤ê¤Þ¤¹¡£
//
function plugin_touchgraph_action()
{
+ pkwk_headers_sent();
header('Content-type: text/plain');
plugin_touchgraph_rel();
// plugin_touchgraph_ref(); // reverse
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: tracker.inc.php,v 1.25 2004/11/30 13:15:40 henoheno Exp $
+// $Id: tracker.inc.php,v 1.26 2004/12/02 11:34:25 henoheno Exp $
//
// tracker_list¤Çɽ¼¨¤·¤Ê¤¤¥Ú¡¼¥¸Ì¾(Àµµ¬É½¸½¤Ç)
$r_page = rawurlencode($page);
+ pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . $r_page);
exit;
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: pukiwiki.ini.php,v 1.98 2004/11/30 14:20:50 henoheno Exp $
+// $Id: pukiwiki.ini.php,v 1.99 2004/12/02 11:29:47 henoheno Exp $
//
// PukiWiki setting file
/////////////////////////////////////////////////
+// Init
+
+if (! defined('PKWK_SAFE_MODE'))
+ define('PKWK_SAFE_MODE', FALSE); // FALSE or TRUE
+
+if (! defined('PKWK_OPTIMISE'))
+ define('PKWK_OPTIMISE', FALSE); // FALSE or TRUE
+
+/////////////////////////////////////////////////
// ½é´üÀßÄê (ʸ»ú¥¨¥ó¥³¡¼¥É¡¢¸À¸ì)
// Internal Language ('en' or 'ja')