Send 403 if publishing is disabled. Props AlanJCastonguay. see #7157

git-svn-id: https://develop.svn.wordpress.org/trunk@8267 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-07-07 19:19:47 +00:00
parent 8887dcc0a2
commit 497ea49a77
1 changed files with 9 additions and 1 deletions

View File

@ -197,7 +197,7 @@ class AtomServer {
// check to see if AtomPub is enabled
if( !get_option( 'enable_app' ) )
$this->not_allowed( sprintf( __( 'AtomPub services are disabled on this blog. An admin user can enable them at %s' ), admin_url('options-writing.php') ) );
$this->forbidden( sprintf( __( 'AtomPub services are disabled on this blog. An admin user can enable them at %s' ), admin_url('options-writing.php') ) );
// dispatch
foreach($this->selectors as $regex => $funcs) {
@ -939,6 +939,14 @@ list($content_type, $content) = prep_atom_text_construct(get_the_content()); ?>
exit;
}
function forbidden($reason='') {
log_app('Status','403: Forbidden');
header('Content-Type: text/plain');
status_header('403');
echo $reason;
exit;
}
function not_found() {
log_app('Status','404: Not Found');
header('Content-Type: text/plain');