Make WordPress Core

Opened 9 years ago

Last modified 3 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:


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)

wp-filesystem-ftpext.patch (1.4 KB) - added by Przemyslaw Plewa 9 years ago.
23845.diff (1.1 KB) - added by dd32 8 years ago.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
9 years ago

  • Component changed from General to Filesystem

#2 @dd32
9 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 @Przemyslaw Plewa
9 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/

Last edited 9 years ago by SergeyBiryukov (previous) (diff)

8 years ago

#4 @dd32
8 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.

#5 @chriscct7
6 years ago

Any updated thoughts @dd32?

Note: See TracTickets for help on using tickets.