Ticket #22900: 22900.hotfix.diff

File 22900.hotfix.diff, 2.3 KB (added by dd32, 5 months ago)
Line 
1Index: hotfix.php
2===================================================================
3--- hotfix.php  (revision 639537)
4+++ hotfix.php  (working copy)
5@@ -35,7 +35,7 @@
6 
7        switch ( $wp_version ) {
8                case '3.5' :
9-                       $hotfixes = array( '350_twentytwelve' );
10+                       $hotfixes = array( '350_twentytwelve', '350_iis_http_failure' );
11                        break;
12                case '3.4.2' :
13                        $hotfixes = array( '342_custom_fields' );
14@@ -217,3 +217,24 @@
15        return wp_remote_post( $url, $args );
16 }
17 
18+function wp_hotfix_350_iis_http_failure() {
19+       add_filter( 'filesystem_method', 'wp_hotfix_350_iis_http_failure_define' );
20+}
21+
22+function wp_hotfix_350_iis_http_failure_define( $filter ) {
23+       if ( ! defined( 'WP_TEMP_DIR' ) )
24+               define( 'WP_TEMP_DIR', wp_hotfix_350_iis_http_failure_get_temp_dir() );
25+       remove_filter( 'filesystem_method', 'wp_hotfix_350_iis_http_failure_define' );
26+       return $filter;
27+}
28+
29+function wp_hotfix_350_iis_http_failure_get_temp_dir() {
30+       $temp = ini_get('upload_tmp_dir');
31+       if ( is_dir( $temp ) && @is_writable( $temp ) )
32+               return trailingslashit( rtrim( $temp, '\\' ) );
33+
34+       $temp = WP_CONTENT_DIR . '/';
35+       if ( is_dir( $temp ) && @is_writable( $temp ) )
36+               return $temp;
37+       return false;
38+}
39\ No newline at end of file
40Index: readme.txt
41===================================================================
42--- readme.txt  (revision 639537)
43+++ readme.txt  (working copy)
44@@ -15,6 +15,7 @@
45 
46 * **WordPress 3.5**
47        * Lets you update Twenty Twelve if it is shown as "broken" after installing 3.5
48+       * Lets you update WordPress, or, install/update Themes, and Plugins on IIS7 under certain conditions
49 
50 * **WordPress 3.4.2**
51        * Fix adding and updating Custom Fields
52@@ -34,6 +35,9 @@
53 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.
54 
55 == Changelog ==
56+= 1.1 =
57+* Lets you update WordPress, or, install/update Themes, and Plugins on IIS7 under certain conditions
58+
59 = 1.0 =
60 * Lets you update Twenty Twelve if it is shown as "broken" after installing 3.5
61 
62@@ -93,6 +97,7 @@
63 == Complete Hotfix List ==
64 * **WordPress 3.5**
65        * Lets you update Twenty Twelve if it is shown as "broken" after installing 3.5
66+       * Lets you update WordPress, or, install/update Themes, and Plugins on IIS7 under certain conditions
67 
68 * **WordPress 3.4.2**
69        * Fix adding and updating Custom Fields