Make WordPress Core

Opened 6 months ago

#52575 new defect (bug)

get_home_path() returns "/" instead of path to WordPress directory

Reported by: pixellogik Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.6.1
Component: Filesystem API Keywords:
Focuses: Cc:


Wrong return value from get_home_path() in /wp-admin/includes/file.php

Expected result: Absolute filesystem path to the root of the WordPress installation
Result in situation below: /

A WordPress in its own directory installed according method II mentioned here

Settings (Example)
Wordpress: https://pixellogik.de/wp
Website: https://pixellogik.de

Plugin WP-SCSS installed

Open https://pixellogik.de in a browser

The plugin calls get_home_path() in enqueue_files() in line 213

Due to the unexpected value "/" of get_home_path() the URL of the generated CSS file does not point to a file.
The CSS won't be loaded, the site looks scrambled.

What went wrong?
If SCRIPT_FILENAME is outside the installation directory, the directory can't be found. This case is not handled, hence value "/" is returned

Possible fix:
return ABSPATH in that case

Change History (0)

Note: See TracTickets for help on using tickets.