HEX
Server: Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 mod_fcgid/2.3.9 PHP/5.4.16
System: Linux dvm.vladweb.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: region-gk.ru (1016)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: /home/region-gk.ru/data/www/region-gk.ru/wp-content/plugins/backwpup/inc/class-path-fixer.php
<?php

/**
 * Fix paths so they don't trigger an error on Windows.
 *
 * This class is meant to be a workaround for PHP bug #43817.
 *
 * On Windows IIS, if the parent directory is not readable, then the given directory will give access denied.
 *
 * @since 3.4.0
 */
class BackWPup_Path_Fixer {

	/**
	 * Fix the path if necessary.
	 *
	 * @param string $path
	 *
	 * @return string The fixed path.
	 */
	public static function fix_path( $path ) {
		if ( get_site_option( 'backwpup_cfg_windows' ) ) {
			$path = trailingslashit( $path );

			if ( is_dir( $path . 'wp-content' ) ) {
				return $path . 'wp-content/..';
			}
		}

		return $path;
	}
	
	public static function slashify( $path ) {
		return str_replace( '\\', '/', $path );
	}

}