Skip to content

Commit

Permalink
fix(WPLoader) pull const information only from configured installations
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Aug 27, 2023
1 parent 6bf5c0c commit 11e8f5a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Module/WPLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,12 @@ public function _initialize(): void
}

// Define the path-related constants read from the installation, if any.
foreach (['WP_CONTENT_DIR', 'WP_PLUGIN_DIR', 'WPMU_PLUGIN_DIR'] as $pathConst) {
$constValue = $this->installation->getState()->getConstant($pathConst);
if ($constValue && is_string($constValue)) {
$config[$pathConst] = $constValue;
if ($this->installation->isConfigured()) {
foreach (['WP_CONTENT_DIR', 'WP_PLUGIN_DIR', 'WPMU_PLUGIN_DIR'] as $pathConst) {
$constValue = $this->installation->getState()->getConstant($pathConst);
if ($constValue && is_string($constValue)) {
$config[$pathConst] = $constValue;
}
}
}

Expand Down

0 comments on commit 11e8f5a

Please sign in to comment.