Ticket #22900: hotfix.22900.diff
File hotfix.22900.diff, 2.7 KB (added by , 13 years ago) |
---|
-
hotfix.php
35 35 36 36 switch ( $wp_version ) { 37 37 case '3.5' : 38 $hotfixes = array( '350_twentytwelve' );38 $hotfixes = array( '350_twentytwelve', '350_iis_http_failure' ); 39 39 break; 40 40 case '3.4.2' : 41 41 $hotfixes = array( '342_custom_fields' ); … … 217 217 return wp_remote_post( $url, $args ); 218 218 } 219 219 220 function wp_hotfix_350_iis_http_failure() { 221 add_action( 'pre_http_request', 'wp_hotfix_350_iis_http_failure_pre_http_request', 10, 3 ); 222 } 223 224 function wp_hotfix_350_iis_http_failure_pre_http_request( $return, $args, $url ) { 225 if ( ! $args['stream'] ) 226 return $return; 227 if ( $args['filename'] && @is_writable( dirname( $args['filename'] ) ) ) 228 return $return; 229 230 $filename = $args['filename'] ? basename( $args['filename'] ) : basename( $url ); 231 232 $temp_dir = wp_hotfix_350_iis_http_failure_get_temp_dir(); 233 if ( ! $temp_dir ) 234 return new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) ); // Core string 235 236 $args['filename'] = $temp_dir . $filename; 237 238 return wp_remote_request( $url, $args ); 239 } 240 241 function wp_hotfix_350_iis_http_failure_get_temp_dir() { 242 $temp = ini_get('upload_tmp_dir'); 243 if ( is_dir( $temp ) && @is_writable( $temp ) ) 244 return trailingslashit( rtrim( $temp, '\\' ) ); 245 246 $temp = WP_CONTENT_DIR . '/'; 247 if ( is_dir( $temp ) && @is_writable( $temp ) ) 248 return $temp; 249 return false; 250 } 251 No newline at end of file -
readme.txt
15 15 16 16 * **WordPress 3.5** 17 17 * Lets you update Twenty Twelve if it is shown as "broken" after installing 3.5 18 * Lets you update WordPress, or, install/update Themes, and Plugins on IIS7 under certain conditions 18 19 19 20 * **WordPress 3.4.2** 20 21 * Fix adding and updating Custom Fields … … 34 35 Read the "Complete Hotfix List" section in the description. A later version of the plugin may list the hotfixes in a special WordPress admin page. 35 36 36 37 == Changelog == 38 = 1.1 = 39 * Lets you update WordPress, or, install/update Themes, and Plugins on IIS7 under certain conditions 40 37 41 = 1.0 = 38 42 * Lets you update Twenty Twelve if it is shown as "broken" after installing 3.5 39 43 … … 93 97 == Complete Hotfix List == 94 98 * **WordPress 3.5** 95 99 * Lets you update Twenty Twelve if it is shown as "broken" after installing 3.5 100 * Lets you update WordPress, or, install/update Themes, and Plugins on IIS7 under certain conditions 96 101 97 102 * **WordPress 3.4.2** 98 103 * Fix adding and updating Custom Fields