From 96c00ed1c3033407670d0c4f5f999c9e7fd129b6 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 7 Jul 2008 19:19:47 +0000 Subject: [PATCH] Send 403 if publishing is disabled. Props AlanJCastonguay. see #7157 git-svn-id: http://svn.automattic.com/wordpress/trunk@8267 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-app.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-app.php b/wp-app.php index 26b8a96e2..645109490 100644 --- a/wp-app.php +++ b/wp-app.php @@ -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');