Opened 2 months ago

Last modified 6 weeks ago

#23845 new defect (bug)

Install new theme via FTP failed

Reported by: Przemyslaw Plewa Owned by:
Priority: normal Milestone: Awaiting Review
Component: Filesystem Version: 3.5.1
Severity: normal Keywords: has-patch
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 (1)

wp-filesystem-ftpext.patch (1.4 KB) - added by Przemyslaw Plewa 2 months ago.
patch

Download all attachments as: .zip

Change History (4)

  • Component changed from General to Filesystem

comment:2   dd327 weeks 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?

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 6 weeks ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.