web/wp-admin/includes/class-wp-importer.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
equal deleted inserted replaced
203:f507feede89a 204:09a1c134465b
   130 			if ( !$blog ) {
   130 			if ( !$blog ) {
   131 				fwrite( STDERR, "Error: Could not find blog\n" );
   131 				fwrite( STDERR, "Error: Could not find blog\n" );
   132 				exit();
   132 				exit();
   133 			}
   133 			}
   134 			$blog_id = (int) $blog->blog_id;
   134 			$blog_id = (int) $blog->blog_id;
   135 			// Restore global $current_blog
       
   136 			global $current_blog;
       
   137 			$current_blog = $blog;
       
   138 		}
   135 		}
   139 
   136 
   140 		if ( function_exists( 'is_multisite' ) ) {
   137 		if ( function_exists( 'is_multisite' ) ) {
   141 			if ( is_multisite() )
   138 			if ( is_multisite() )
   142 				switch_to_blog( $blog_id );
   139 				switch_to_blog( $blog_id );
   210 	 * Check if user has exceeded disk quota
   207 	 * Check if user has exceeded disk quota
   211 	 *
   208 	 *
   212 	 * @return bool
   209 	 * @return bool
   213 	 */
   210 	 */
   214 	function is_user_over_quota() {
   211 	function is_user_over_quota() {
   215 		global $current_blog;
       
   216 
       
   217 		if ( function_exists( 'upload_is_user_over_quota' ) ) {
   212 		if ( function_exists( 'upload_is_user_over_quota' ) ) {
   218 			if ( upload_is_user_over_quota( 1 ) ) {
   213 			if ( upload_is_user_over_quota( 1 ) ) {
   219 				echo "Sorry, you have used your upload quota.\n";
   214 				echo "Sorry, you have used your upload quota.\n";
   220 				return true;
   215 				return true;
   221 			}
   216 			}