diff --git wp-admin/includes/misc.php wp-admin/includes/misc.php
index 21baace..3a4333f 100644
|
|
function got_mod_rewrite() { |
39 | 39 | * @since 3.7.0 |
40 | 40 | * |
41 | 41 | * @global bool $is_nginx |
| 42 | * @global bool $is_caddy |
42 | 43 | * |
43 | 44 | * @return bool Whether the server supports URL rewriting. |
44 | 45 | */ |
45 | 46 | function got_url_rewrite() { |
46 | | $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || iis7_supports_permalinks() ); |
| 47 | $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || $GLOBALS['is_caddy'] || iis7_supports_permalinks() ); |
47 | 48 | |
48 | 49 | /** |
49 | 50 | * Filters whether URL rewriting is available. |
diff --git wp-admin/options-permalink.php wp-admin/options-permalink.php
index c7193f9..2fb1bd6 100644
|
|
if ( $iis7_permalinks ) { |
75 | 75 | $writable = true; |
76 | 76 | else |
77 | 77 | $writable = false; |
78 | | } elseif ( $is_nginx ) { |
| 78 | } elseif ( $is_nginx || $is_caddy ) { |
79 | 79 | $writable = false; |
80 | 80 | } else { |
81 | 81 | if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) { |
… |
… |
if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { |
134 | 134 | } elseif ( $permalink_structure && ! $using_index_permalinks && $writable ) { |
135 | 135 | $message = __( 'Permalink structure updated. Remove write access on web.config file now!' ); |
136 | 136 | } |
137 | | } elseif ( ! $is_nginx && $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) { |
| 137 | } elseif ( ! $is_nginx && ! $is_caddy && $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) { |
138 | 138 | $message = __( 'You should update your .htaccess now.' ); |
139 | 139 | } |
140 | 140 | |
diff --git wp-includes/vars.php wp-includes/vars.php
index 89b3532..fa402a0 100644
|
|
|
17 | 17 | |
18 | 18 | global $pagenow, |
19 | 19 | $is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, $is_edge, |
20 | | $is_apache, $is_IIS, $is_iis7, $is_nginx; |
| 20 | $is_apache, $is_IIS, $is_iis7, $is_nginx, $is_caddy; |
21 | 21 | |
22 | 22 | // On which page are we ? |
23 | 23 | if ( is_admin() ) { |
… |
… |
$is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos( |
106 | 106 | $is_nginx = (strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false); |
107 | 107 | |
108 | 108 | /** |
| 109 | * Whether the server software is Caddy or something else |
| 110 | * @global bool $is_caddy |
| 111 | */ |
| 112 | $is_caddy = (strpos($_SERVER['SERVER_SOFTWARE'], 'Caddy') !== false); |
| 113 | |
| 114 | /** |
109 | 115 | * Whether the server software is IIS or something else |
110 | 116 | * @global bool $is_IIS |
111 | 117 | */ |