From 0ca06272a42c353cbb27808b909ad6cbea5589f9 Mon Sep 17 00:00:00 2001 From: Caleb Stauffer Date: Wed, 4 Oct 2023 09:57:11 -0400 Subject: [PATCH] prevent symlink creation if DISALLOW_FILE_MODS is truthy --- classes/Activation.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/Activation.php b/classes/Activation.php index c32d55623..45b44a848 100644 --- a/classes/Activation.php +++ b/classes/Activation.php @@ -32,6 +32,10 @@ public function activate( $sitewide = false ) { $db = WP_CONTENT_DIR . '/db.php'; $create_symlink = defined( 'QM_DB_SYMLINK' ) ? QM_DB_SYMLINK : true; + if ( $create_symlink && defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) { + $create_symlink = false; + } + if ( $create_symlink && ! file_exists( $db ) && function_exists( 'symlink' ) ) { @symlink( $this->plugin_path( 'wp-content/db.php' ), $db ); // phpcs:ignore }