From f4f354f67c367baf3560d14320d86f2507488195 Mon Sep 17 00:00:00 2001 From: carmoreira Date: Wed, 18 Aug 2021 17:59:50 +0200 Subject: [PATCH] csf update to fix path issues on some edge cases --- lib/codestar-framework/classes/setup.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/codestar-framework/classes/setup.class.php b/lib/codestar-framework/classes/setup.class.php index 3d2934e..d52b33f 100644 --- a/lib/codestar-framework/classes/setup.class.php +++ b/lib/codestar-framework/classes/setup.class.php @@ -283,7 +283,8 @@ public static function constants() { // We need this path-finder code for set URL of framework $dirname = wp_normalize_path( dirname( dirname( __FILE__ ) ) ); $theme_dir = wp_normalize_path( get_parent_theme_file_path() ); - $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR ); + $plugin_dir = str_replace( '//', '/', wp_normalize_path( WP_PLUGIN_DIR ) ); + $plugin_dir = str_replace( '/opt/bitnami', '/bitnami', $plugin_dir ); $located_plugin = ( preg_match( '#'. self::sanitize_dirname( $plugin_dir ) .'#', self::sanitize_dirname( $dirname ) ) ) ? true : false; $directory = ( $located_plugin ) ? $plugin_dir : $theme_dir; $directory_uri = ( $located_plugin ) ? WP_PLUGIN_URL : get_parent_theme_file_uri();