Ticket #20809: 20809.diff
File 20809.diff, 6.4 KB (added by , 12 years ago) |
---|
-
wp-includes/taxonomy.php
502 502 503 503 foreach ( (array) $taxonomies as $taxonomy ) { 504 504 if ( ! taxonomy_exists( $taxonomy ) ) 505 return new WP_Error( 'invalid_taxonomy', __( 'Invalid Taxonomy' ) );505 return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) ); 506 506 } 507 507 508 508 $defaults = array( 'order' => 'ASC' ); … … 855 855 } 856 856 857 857 if ( ! taxonomy_exists($taxonomy) ) { 858 $error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));858 $error = new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); 859 859 return $error; 860 860 } 861 861 … … 984 984 */ 985 985 function get_term_children( $term_id, $taxonomy ) { 986 986 if ( ! taxonomy_exists($taxonomy) ) 987 return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));987 return new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); 988 988 989 989 $term_id = intval( $term_id ); 990 990 … … 1174 1174 1175 1175 foreach ( $taxonomies as $taxonomy ) { 1176 1176 if ( ! taxonomy_exists($taxonomy) ) { 1177 $error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));1177 $error = new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); 1178 1178 return $error; 1179 1179 } 1180 1180 } … … 1875 1875 1876 1876 foreach ( (array) $taxonomies as $taxonomy ) { 1877 1877 if ( ! taxonomy_exists($taxonomy) ) 1878 return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));1878 return new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); 1879 1879 } 1880 1880 1881 1881 if ( !is_array($object_ids) ) … … 2146 2146 $object_id = (int) $object_id; 2147 2147 2148 2148 if ( ! taxonomy_exists($taxonomy) ) 2149 return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));2149 return new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); 2150 2150 2151 2151 if ( !is_array($terms) ) 2152 2152 $terms = array($terms); -
wp-includes/class-wp-xmlrpc-server.php
1473 1473 do_action( 'xmlrpc_call', 'wp.newTerm' ); 1474 1474 1475 1475 if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) 1476 return new IXR_Error( 403, __( 'Invalid taxonomy .' ) );1476 return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); 1477 1477 1478 1478 $taxonomy = get_taxonomy( $content_struct['taxonomy'] ); 1479 1479 … … 1561 1561 do_action( 'xmlrpc_call', 'wp.editTerm' ); 1562 1562 1563 1563 if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) 1564 return new IXR_Error( 403, __( 'Invalid taxonomy .' ) );1564 return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); 1565 1565 1566 1566 $taxonomy = get_taxonomy( $content_struct['taxonomy'] ); 1567 1567 … … 1653 1653 do_action( 'xmlrpc_call', 'wp.deleteTerm' ); 1654 1654 1655 1655 if ( ! taxonomy_exists( $taxonomy ) ) 1656 return new IXR_Error( 403, __( 'Invalid taxonomy .' ) );1656 return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); 1657 1657 1658 1658 $taxonomy = get_taxonomy( $taxonomy ); 1659 1659 … … 1720 1720 do_action( 'xmlrpc_call', 'wp.getTerm' ); 1721 1721 1722 1722 if ( ! taxonomy_exists( $taxonomy ) ) 1723 return new IXR_Error( 403, __( 'Invalid taxonomy .' ) );1723 return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); 1724 1724 1725 1725 $taxonomy = get_taxonomy( $taxonomy ); 1726 1726 … … 1773 1773 do_action( 'xmlrpc_call', 'wp.getTerms' ); 1774 1774 1775 1775 if ( ! taxonomy_exists( $taxonomy ) ) 1776 return new IXR_Error( 403, __( 'Invalid taxonomy .' ) );1776 return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); 1777 1777 1778 1778 $taxonomy = get_taxonomy( $taxonomy ); 1779 1779 … … 1852 1852 do_action( 'xmlrpc_call', 'wp.getTaxonomy' ); 1853 1853 1854 1854 if ( ! taxonomy_exists( $taxonomy ) ) 1855 return new IXR_Error( 403, __( 'Invalid taxonomy .' ) );1855 return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); 1856 1856 1857 1857 $taxonomy = get_taxonomy( $taxonomy ); 1858 1858 … … 2950 2950 return $this->error; 2951 2951 2952 2952 if ( !current_user_can( 'upload_files' ) ) 2953 return new IXR_Error( 403, __( 'You are not allowed to upload files to this site.' ) );2953 return new IXR_Error( 403, __( 'You do not have permission to upload files.' ) ); 2954 2954 2955 2955 do_action('xmlrpc_call', 'wp.getMediaItem'); 2956 2956 … … 2995 2995 return $this->error; 2996 2996 2997 2997 if ( !current_user_can( 'upload_files' ) ) 2998 return new IXR_Error( 401, __( ' Sorry, you cannotupload files.' ) );2998 return new IXR_Error( 401, __( 'You do not have permission to upload files.' ) ); 2999 2999 3000 3000 do_action('xmlrpc_call', 'wp.getMediaLibrary'); 3001 3001 … … 3104 3104 do_action( 'xmlrpc_call', 'wp.getPostType' ); 3105 3105 3106 3106 if( ! post_type_exists( $post_type_name ) ) 3107 return new IXR_Error( 403, __( 'Invalid post type .' ) );3107 return new IXR_Error( 403, __( 'Invalid post type' ) ); 3108 3108 3109 3109 $post_type = get_post_type_object( $post_type_name ); 3110 3110 … … 3679 3679 $post_type = 'post'; 3680 3680 } else { 3681 3681 // No other post_type values are allowed here 3682 return new IXR_Error( 401, __( 'Invalid post type .' ) );3682 return new IXR_Error( 401, __( 'Invalid post type' ) ); 3683 3683 } 3684 3684 } else { 3685 3685 if ( $publish ) … … 3735 3735 return(new IXR_Error(401, __('You are not allowed to create pages as this user'))); 3736 3736 break; 3737 3737 default: 3738 return(new IXR_Error(401, __('Invalid post type .')));3738 return(new IXR_Error(401, __('Invalid post type'))); 3739 3739 break; 3740 3740 } 3741 3741 $author = get_userdata( $content_struct['wp_author_id'] ); … … 3987 3987 3988 3988 // Use wp.editPost to edit post types other than post and page. 3989 3989 if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) ) 3990 return new IXR_Error( 401, __( 'Invalid post type .' ) );3990 return new IXR_Error( 401, __( 'Invalid post type' ) ); 3991 3991 3992 3992 // Thwart attempt to change the post type. 3993 3993 if ( ! empty( $content_struct[ 'post_type' ] ) && ( $content_struct['post_type'] != $postdata[ 'post_type' ] ) ) … … 4039 4039 return(new IXR_Error(401, __('You are not allowed to change the page author as this user.'))); 4040 4040 break; 4041 4041 default: 4042 return(new IXR_Error(401, __('Invalid post type .')));4042 return(new IXR_Error(401, __('Invalid post type'))); 4043 4043 break; 4044 4044 } 4045 4045 $post_author = $content_struct['wp_author_id']; … … 4531 4531 do_action('xmlrpc_call', 'metaWeblog.newMediaObject'); 4532 4532 4533 4533 if ( !current_user_can('upload_files') ) { 4534 $this->error = new IXR_Error( 401, __('You are not allowed to upload files to this site.'));4534 $this->error = new IXR_Error( 401, __( 'You do not have permission to upload files.' ) ); 4535 4535 return $this->error; 4536 4536 } 4537 4537