pukiwikiディレクトリ内に lib/auth.php というファイルの中の、以下の部分が認証失敗時の処理のようです。
if ($auth_flag) { header('WWW-Authenticate: Basic realm="' . $_msg_auth . '"'); header('HTTP/1.0 401 Unauthorized'); } if ($exit_flag) { $body = $title = str_replace('$1', htmlspecialchars(strip_bracket($page)), $title_cannot); $page = str_replace('$1', make_search($page), $title_cannot); catbody($title, $page, $body); exit; }
これを以下のように修正すれば良いようです。手元のpukiwikiではうまくいきました。
if ($auth_flag) { header('WWW-Authenticate: Basic realm="' . $_msg_auth . '"'); header('HTTP/1.0 401 Unauthorized'); } if ($exit_flag) { //↓この部分がヘッダーなどの表示をしているのでコメントアウト //$body = $title = str_replace('$1', // htmlspecialchars(strip_bracket($page)), $title_cannot); //$page = str_replace('$1', make_search($page), $title_cannot); //catbody($title, $page, $body); echo "401 Unauthorized"; //←代わりにシンプルなメッセージを追加 exit; }
素晴らしい!ありがとうございます!