Closed schlessera closed 8 years ago
@schlessera we can use the same line that core uses.
I myself add this issue once, and shipped the index.php
under version control, then prevented WP Starter to edit it via prevent-overwrite
setting.
The only reason for realpath
was that the path to load is "calculated" by WP Starter. If something goes wrong in calculation, realpath
return false
so the line do nothing, and avoid to try to load an inexistent file which will cause a fatal error.
However, since I use WP Starter, bad calculation never happened, so I guess we can remove it with no issue.
If you have time for a PR I'll merge it, otherwise I'll do the change later today.
Just tested, and an absolute path seems to work. Also, it does not seem to depend on specific whitespace.
So, your proposed change should solve this issue.
I've got 2.3.2, and yet, when I do a new install, or rename wp-config.php
to something else and call composer run wpstarter
, I get wp-config.php
with the realpath
part still present.
Oh, this PR only affected index.php
. Nevermind.
The Codex article gives a very specific code snippet under point 9. of how to go about letting the site know about the subfolder WordPress is installed in.
Hosting providers like SiteGround rely on this line of code to detect whether WordPress was installed in a subfolder, and modify their system setup accordingly (for things like version detection, caching extensions, etc...).
WPStarter has changed this line to use
realpath
instead of the code that is recommended in the Codex, which breaks detection on these hosts.Is there a specific reason why this was changed to use
realpath
? I'd like to investigate whether we could leave that particular file exactly as is recommended in the Codex, and solve whatever issuerealpath
was meant to solve in a different location.