+ // For files in resources, extensions/ or skins/, ResourceBasePath is preferred here.
+ // For other misc files in $IP, we'll fallback to that as well. There is, however, a fourth
+ // supported dir/path pair in the configuration (wgUploadDirectory, wgUploadPath)
+ // which is not expected to be in wgResourceBasePath on CDNs. (T155146)
+ $uploadPath = $config->get( 'UploadPath' );
+ if ( strpos( $path, $uploadPath ) === 0 ) {
+ $localDir = $config->get( 'UploadDirectory' );
+ $remotePathPrefix = $remotePath = $uploadPath;
+ }
+