Skip to content

Commit 264d2aa

Browse files
swissspidyCopilot
andauthored
Update src/WP_CLI/CommandWithUpgrade.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 881032e commit 264d2aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@ protected function install_from_php_file( $url, $assoc_args ) {
394394
if ( ! is_dir( WP_PLUGIN_DIR ) ) {
395395
return new WP_Error( 'invalid_path', 'Unable to create plugin directory.' );
396396
}
397+
398+
// Verify that the plugin directory was successfully created.
399+
if ( ! is_dir( WP_PLUGIN_DIR ) ) {
400+
return new WP_Error( 'invalid_path', 'Unable to create plugin directory.' );
401+
}
397402
}
398403

399404
// Validate the destination stays within the plugin directory (prevent directory traversal).

0 commit comments

Comments
 (0)