Remove AtomPub from core.

* Will be replaced with http://wordpress.org/extend/plugins/atom-publishing-protocol/.
 * Introduces an action, xmlrpc_rsd_apis, to add APIs to xmlrpc.php?rsd.
 * Introduces support for 'error' being 403 and 50x in class-wp.php.
 * Removes 'Remote Publishing' from Writing Settings (see [21804]). Keeps the remote_publishing settings section.

DB version is bumped to generate the new wp-app rewrite rule and remove the old enable_app option.

props wonderboymusic.
fixes #21509.



git-svn-id: https://develop.svn.wordpress.org/trunk@21818 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-09-11 20:11:39 +00:00
parent a5e8f80f58
commit dfac91464f
14 changed files with 53 additions and 1586 deletions
+1 -1
View File
@@ -730,7 +730,7 @@ function is_admin_bar_showing() {
global $show_admin_bar, $pagenow;
// For all these types of requests, we never want an admin bar.
if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
if ( defined('XMLRPC_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
return false;
// Integrated into the admin.
File diff suppressed because it is too large Load Diff
+14 -12
View File
@@ -195,7 +195,7 @@ class WP {
$query = $rewrite['$'];
$matches = array('');
}
} else if ( $req_uri != 'wp-app.php' ) {
} else {
foreach ( (array) $rewrite as $match => $query ) {
// If the requesting file is the anchor of the match, prepend it to the path info.
if ( ! empty($req_uri) && strpos($match, $req_uri) === 0 && $req_uri != $request )
@@ -229,16 +229,14 @@ class WP {
// Parse the query.
parse_str($query, $perma_query_vars);
// If we're processing a 404 request, clear the error var
// since we found something.
unset( $_GET['error'] );
unset( $error );
// If we're processing a 404 request, clear the error var since we found something.
if ( '404' == $error )
unset( $error, $_GET['error'] );
}
// If req_uri is empty or if it is a request for ourself, unset error.
if ( empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) {
unset( $_GET['error'] );
unset( $error );
unset( $error, $_GET['error'] );
if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false )
unset( $perma_query_vars );
@@ -325,11 +323,15 @@ class WP {
if ( is_user_logged_in() )
$headers = array_merge($headers, wp_get_nocache_headers());
if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) {
$status = 404;
if ( !is_user_logged_in() )
$headers = array_merge($headers, wp_get_nocache_headers());
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
if ( ! empty( $this->query_vars['error'] ) ) {
$status = (int) $this->query_vars['error'];
if ( 404 === $status ) {
if ( ! is_user_logged_in() )
$headers = array_merge($headers, wp_get_nocache_headers());
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
} elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) {
$exit_required = true;
}
} else if ( empty($this->query_vars['feed']) ) {
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
} else {
-2
View File
@@ -1910,8 +1910,6 @@ function wp_die( $message = '', $title = '', $args = array() ) {
$function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
$function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
elseif ( defined( 'APP_REQUEST' ) && APP_REQUEST )
$function = apply_filters( 'wp_die_app_handler', '_scalar_wp_die_handler' );
else
$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' );
+22
View File
@@ -168,3 +168,25 @@ function wp_login($username, $password, $deprecated = '') {
else :
_deprecated_function( 'wp_login', '2.5', 'wp_signon()' );
endif;
/**
* WordPress AtomPub API implementation.
*
* Originally stored in wp-app.php, and later wp-includes/class-wp-atom-server.php.
* It is kept here in case a plugin directly referred to the class.
*
* @since 2.2.0
* @deprecated 3.5.0
* @link http://wordpress.org/extend/plugins/atom-publishing-protocol/
*/
if ( ! class_exists( 'wp_atom_server' ) ) {
class wp_atom_server {
public function __call( $name, $arguments ) {
_deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Platform plugin' );
}
public static function __callStatic( $name, $arguments ) {
_deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Platform plugin' );
}
}
}
+1 -4
View File
@@ -4670,9 +4670,8 @@ function _future_post_hook( $deprecated = '', $post ) {
* @since 2.3.0
* @access private
* @uses $wpdb
* @uses XMLRPC_REQUEST and APP_REQUEST constants.
* @uses XMLRPC_REQUEST constant.
* @uses do_action() Calls 'xmlprc_publish_post' on post ID if XMLRPC_REQUEST is defined.
* @uses do_action() Calls 'app_publish_post' on post ID if APP_REQUEST is defined.
*
* @param int $post_id The ID in the database table of the post being published
*/
@@ -4681,8 +4680,6 @@ function _publish_post_hook($post_id) {
if ( defined('XMLRPC_REQUEST') )
do_action('xmlrpc_publish_post', $post_id);
if ( defined('APP_REQUEST') )
do_action('app_publish_post', $post_id);
if ( defined('WP_IMPORTING') )
return;
+7 -4
View File
@@ -1525,8 +1525,11 @@ class WP_Rewrite {
$home_path = parse_url( home_url() );
$robots_rewrite = ( empty( $home_path['path'] ) || '/' == $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array();
// Old feed files
$old_feed_files = array( '.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$' => $this->index . '?feed=old' );
// Old feed and service files
$deprecated_files = array(
'.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$' => $this->index . '?feed=old',
'.*wp-app\.php$' => $this->index . '?error=403',
);
// Registration rules
$registration_pages = array();
@@ -1585,9 +1588,9 @@ class WP_Rewrite {
// Put them together.
if ( $this->use_verbose_page_rules )
$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules);
$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $deprecated_files, $old_service_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules);
else
$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $deprecated_files, $old_service_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
do_action_ref_array('generate_rewrite_rules', array(&$this));
$this->rules = apply_filters('rewrite_rules_array', $this->rules);
+1 -1
View File
@@ -11,7 +11,7 @@ $wp_version = '3.5-alpha-21751';
*
* @global int $wp_db_version
*/
$wp_db_version = 21811;
$wp_db_version = 21818;
/**
* Holds the TinyMCE version