315 | | $wp_dir_from_root = preg_replace( '#^' . preg_quote( $_SERVER['DOCUMENT_ROOT'], '#' ) . '#', '', ABSPATH ); |
316 | | $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) ); |
| 316 | $document_root = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) ); |
| 317 | $sanitized_abspath = str_replace( '\\', '/', ABSPATH ); |
| 318 | if ( false !== strpos( $sanitized_abspath, $document_root ) ) { |
| 319 | $wp_dir_from_root = preg_replace( '#^' . preg_quote( $document_root, '#' ) . '#', '', $sanitized_abspath ); |
| 320 | $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) ); |
| 321 | } else { |
| 322 | $wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', ABSPATH ); |
| 323 | } |