? $info['ResourceFileModulePaths']
: false;
if ( isset( $defaultPaths['localBasePath'] ) ) {
- $defaultPaths['localBasePath'] = "$dir/{$defaultPaths['localBasePath']}";
+ if ( $defaultPaths['localBasePath'] === '' ) {
+ // Avoid double slashes (e.g. /extensions/Example//path)
+ $defaultPaths['localBasePath'] = $dir;
+ } else {
+ $defaultPaths['localBasePath'] = "$dir/{$defaultPaths['localBasePath']}";
+ }
}
foreach ( [ 'ResourceModules', 'ResourceModuleSkinStyles' ] as $setting ) {
if ( isset( $info[$setting] ) ) {
foreach ( $info[$setting] as $name => $data ) {
if ( isset( $data['localBasePath'] ) ) {
- $data['localBasePath'] = "$dir/{$data['localBasePath']}";
+ if ( $data['localBasePath'] === '' ) {
+ // Avoid double slashes (e.g. /extensions/Example//path)
+ $data['localBasePath'] = $dir;
+ } else {
+ $data['localBasePath'] = "$dir/{$data['localBasePath']}";
+ }
}
if ( $defaultPaths ) {
$data += $defaultPaths;
}
public static function provideExtractResourceLoaderModules() {
- $dir = __DIR__ . '/FooBar/';
+ $dir = __DIR__ . '/FooBar';
return [
// Generic module with localBasePath/remoteExtPath specified
[
],
'test.bar' => [
'styles' => 'bar.js',
- 'localBasePath' => $dir . 'subdir',
+ 'localBasePath' => "$dir/subdir",
'remoteExtPath' => 'FooBar/subdir',
],
'test.class' => [