Skip to content

Commit 4ad3ff8

Browse files
committed
[starter] [symlink] Symlink SDK relative path "calculation" enhancement.
1 parent 6d6ec77 commit 4ad3ff8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

start.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* @var string
1717
*/
18-
$this_sdk_version = '2.11.0';
18+
$this_sdk_version = '2.11.0.1';
1919

2020
#region SDK Selection Logic --------------------------------------------------------------------
2121

@@ -128,12 +128,16 @@ function_exists( 'wp_is_json_request' ) &&
128128
* The check of `fs_find_direct_caller_plugin_file` determines that this file was indeed included by a different plugin than the main plugin.
129129
*/
130130
if ( DIRECTORY_SEPARATOR . $this_sdk_relative_path === $fs_root_path && function_exists( 'fs_find_direct_caller_plugin_file' ) ) {
131-
$original_plugin_dir_name = dirname( fs_find_direct_caller_plugin_file( $file_path ) );
131+
$direct_caller_plugin_file = fs_find_direct_caller_plugin_file( $file_path );
132132

133-
// Remove everything before the original plugin directory name.
134-
$this_sdk_relative_path = substr( $this_sdk_relative_path, strpos( $this_sdk_relative_path, $original_plugin_dir_name ) );
133+
if ( ! empty( $direct_caller_plugin_file ) ) {
134+
$original_plugin_dir_name = dirname( $direct_caller_plugin_file );
135135

136-
unset( $original_plugin_dir_name );
136+
// Remove everything before the original plugin directory name.
137+
$this_sdk_relative_path = substr( $this_sdk_relative_path, strpos( $this_sdk_relative_path, $original_plugin_dir_name ) );
138+
139+
unset( $original_plugin_dir_name );
140+
}
137141
}
138142
}
139143

0 commit comments

Comments
 (0)