Opened 12 years ago
Last modified 6 years ago
#23845 new defect (bug)
Install new theme via FTP failed
Reported by: | Przemyslaw Plewa | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.1 |
Component: | Filesystem API | Keywords: | has-unit-tests |
Focuses: | Cc: |
Description
New theme installation via FTP has failed when we specified custom FTP_BASE folder. If we try this theme installation , wordpress shows error message: "Unable to locate WordPress theme directory". This was because search_for_folder method do not respect FTP_BASE setting and allows to walking on parent directories. All solutions I found in google is ugly hacks who only mask the problem but does not resolved it
I attached patch example who resolve this problem. I hope is useful and will help to repair this bug.
Attachments (2)
Change History (7)
#2
@
12 years ago
Can you provide some more details that explains the environment you're running in, and why FTP_BASE is required?
Are you defining the other FTP_* constants for other paths?
Does it work when you do? (I'm specifically thinking of FTP_CONTENT_DIR )
Do Plugin installs work?
#3
@
12 years ago
In wp-config.php i definded FTP_ constants:
define('FTP_BASE', '/zupa.web5.beep.pl/');
define('FTP_CONTENT_DIR', '/zupa.web5.beep.pl/wp-content/');
define('FTP_PLUGIN_DIR', '/zupa.web5.beep.pl/wp-content/plugins');
define('FTP_LANG_DIR', '/zupa.web5.beep.pl/wp-content/languages');
Plugin installs works fine, upgrade wordpress (tested from 3.5.0 to 3.5.1) works too. Only install themes cause problems. With my patch all it's ok.
Physically my files stored in path: /home/virtualki/88211
Via FTP wordpress files located in /zupa.web5.beep.pl/
#4
@
11 years ago
- Keywords has-unit-tests added; has-patch removed
- Milestone changed from Awaiting Review to Future Release
Added some unit tests that show this case. Unfortunately, I don't think there's going to be any easy way to fix this particular use-case.
This is similar to #14401 and #20652
attachment:wp-filesystem-ftpext.patch is ultimately the same as [25057] I believe. In 3.7+ you'll only need to specify the FTP_BASE constant.
patch