diff --git a/all-in-one-wp-security/admin/wp-security-settings-menu.php b/all-in-one-wp-security/admin/wp-security-settings-menu.php index b46101d..172f9d9 100644 --- a/all-in-one-wp-security/admin/wp-security-settings-menu.php +++ b/all-in-one-wp-security/admin/wp-security-settings-menu.php @@ -241,7 +241,8 @@ function render_tab2() $aio_wp_security->debug_logger->log_debug("Nonce check failed on htaccess file save!",4); die("Nonce check failed on htaccess file save!"); } - $htaccess_path = ABSPATH . '.htaccess'; + $home_path = get_home_path(); + $htaccess_path = $home_path . '.htaccess'; $result = AIOWPSecurity_Utility_File::backup_and_rename_htaccess($htaccess_path); //Backup the htaccess file if ($result) @@ -289,7 +290,8 @@ function render_tab2() $is_htaccess = AIOWPSecurity_Utility_Htaccess::check_if_htaccess_contents($new_htaccess_file_path); if ($is_htaccess == 1) { - $active_root_htaccess = ABSPATH.'.htaccess'; + $home_path = get_home_path(); + $active_root_htaccess = $home_path . '.htaccess'; if (!copy($new_htaccess_file_path, $active_root_htaccess)) { //Failed to make a backup copy @@ -363,7 +365,8 @@ function render_tab2() @@ -791,4 +794,4 @@ function check_if_valid_aiowps_settings_file($wp_file) } -} //end class \ No newline at end of file +} //end class diff --git a/all-in-one-wp-security/classes/wp-security-utility-file.php b/all-in-one-wp-security/classes/wp-security-utility-file.php index 44b05b7..c0a777e 100644 --- a/all-in-one-wp-security/classes/wp-security-utility-file.php +++ b/all-in-one-wp-security/classes/wp-security-utility-file.php @@ -13,11 +13,12 @@ function __construct(){ //Get wp-config.php file path $wp_config_path = AIOWPSecurity_Utility_File::get_wp_config_file_path(); + $home_path = get_home_path(); $this->files_and_dirs_to_check = array( array('name'=>'root directory','path'=>ABSPATH,'permissions'=>'0755'), array('name'=>'wp-includes/','path'=>ABSPATH."wp-includes",'permissions'=>'0755'), - array('name'=>'.htaccess','path'=>ABSPATH.".htaccess",'permissions'=>'0644'), + array('name'=>'.htaccess','path'=> $home_path .".htaccess",'permissions'=>'0644'), array('name'=>'wp-admin/index.php','path'=>ABSPATH."wp-admin/index.php",'permissions'=>'0644'), array('name'=>'wp-admin/js/','path'=>ABSPATH."wp-admin/js/",'permissions'=>'0755'), array('name'=>'wp-content/themes/','path'=>ABSPATH."wp-content/themes",'permissions'=>'0755'), diff --git a/all-in-one-wp-security/classes/wp-security-utility-htaccess.php b/all-in-one-wp-security/classes/wp-security-utility-htaccess.php index 0f9131f..2bd003d 100644 --- a/all-in-one-wp-security/classes/wp-security-utility-htaccess.php +++ b/all-in-one-wp-security/classes/wp-security-utility-htaccess.php @@ -86,7 +86,8 @@ static function write_to_htaccess() return false; //unable to write to the file } - $htaccess = ABSPATH . '.htaccess'; + $home_path = get_home_path(); + $htaccess = $home_path . '.htaccess'; if (!$f = @fopen($htaccess, 'a+')) { @chmod($htaccess, 0644); @@ -135,7 +136,8 @@ static function write_to_htaccess() static function delete_from_htaccess($section = 'All In One WP Security') { //TODO - $htaccess = ABSPATH . '.htaccess'; + $home_path = get_home_path(); + $htaccess = $home_path . '.htaccess'; @ini_set('auto_detect_line_endings', true); if (!file_exists($htaccess)) { @@ -1138,4 +1140,4 @@ protected static function add_netmask($ips) { return $output; } -} \ No newline at end of file +}