-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the location of wp-config.php when attempting to work out the hom…
…e path
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3e213ac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change on line 213 breaks installs with wp-config.php one directory above ABSPATH. It ends up stripping (in my case) public_html from the real ABSPATH path. So an attempt to download a backup zip using the path calculated in admin/actions.php (https://github.com/humanmade/backupwordpress/blob/master/admin/actions.php#L125) it ends up looking like http//mydomain.com/public_html/wp-content/backupwordpress-xxxx... where the public_html should not be there.
Two things:
3e213ac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely a regression, I've opened #64 so we can fix.
ABSPATH
is the path equivalent ofsite_url()
, thus if WordPress is installed in a subdirectoryABSPATH
is the path to the subdirectory, we need the path to the root of the site (as that is where we backup from).The backup download url could be calculated using
WP_CONTENT_URL
however that would break download urls for people who store backups in a folder outside ofWP_CONTENT_DIR
but still inside web root (admittedly that's probably not something many/anyone is doing).HM_Backup::get_home_path()
needs unit tests ideally.