diff --git a/packages/core/src/lib/util/media.util.ts b/packages/core/src/lib/util/media.util.ts index 2872326a6..c8fb5afe7 100644 --- a/packages/core/src/lib/util/media.util.ts +++ b/packages/core/src/lib/util/media.util.ts @@ -331,7 +331,7 @@ export function selectMediaFilePath( publicFolder = evaluateFolder('public_folder', config, collection!, entryMap, field); } - if (mediaPathDir.includes(publicFolder) && mediaPathDir != mediaFolder) { + if (mediaPathDir.startsWith(publicFolder) && mediaPathDir != mediaFolder) { mediaFolder = selectMediaFolder( config, collection,