Refactor Dockerfile and Dockerfile.Staging to streamline package installations; enhance PictureService for safer SEO filename handling
This commit is contained in:
parent
b894a94133
commit
048b160d04
@ -50,9 +50,8 @@ RUN apk add --no-cache icu-libs icu-data-full
|
|||||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
||||||
|
|
||||||
# installs required packages
|
# installs required packages
|
||||||
RUN apk add tiff --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ --allow-untrusted
|
RUN apk add --no-cache tiff libc-dev tzdata
|
||||||
RUN apk add libgdiplus --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted
|
RUN apk add --no-cache libgdiplus --repository https://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted
|
||||||
RUN apk add libc-dev tzdata --no-cache
|
|
||||||
|
|
||||||
# copy entrypoint script
|
# copy entrypoint script
|
||||||
COPY ./entrypoint.sh /entrypoint.sh
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
|
|||||||
@ -50,9 +50,8 @@ RUN apk add --no-cache icu-libs icu-data-full
|
|||||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
||||||
|
|
||||||
# installs required packages
|
# installs required packages
|
||||||
RUN apk add tiff --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ --allow-untrusted
|
RUN apk add --no-cache tiff libc-dev tzdata
|
||||||
RUN apk add libgdiplus --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted
|
RUN apk add --no-cache libgdiplus --repository https://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted
|
||||||
RUN apk add libc-dev tzdata --no-cache
|
|
||||||
|
|
||||||
# copy entrypoint script
|
# copy entrypoint script
|
||||||
COPY ./entrypoint.sh /entrypoint.sh
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
|
|||||||
@ -11,6 +11,7 @@ using Nop.Services.Logging;
|
|||||||
using Nop.Services.Seo;
|
using Nop.Services.Seo;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using Svg.Skia;
|
using Svg.Skia;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Nop.Services.Media;
|
namespace Nop.Services.Media;
|
||||||
|
|
||||||
@ -597,7 +598,14 @@ public partial class PictureService : IPictureService
|
|||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var seoFileName = picture.SeoFilename; // = GetPictureSeName(picture.SeoFilename); //just for sure
|
var seoFileName = picture.SeoFilename;
|
||||||
|
if (!string.IsNullOrEmpty(seoFileName))
|
||||||
|
{
|
||||||
|
// ensure seo filename is safe for filesystem (especially on Windows)
|
||||||
|
seoFileName = await GetPictureSeNameAsync(seoFileName);
|
||||||
|
var invalidChars = Path.GetInvalidFileNameChars();
|
||||||
|
seoFileName = string.Concat(seoFileName.Split(invalidChars, StringSplitOptions.RemoveEmptyEntries));
|
||||||
|
}
|
||||||
|
|
||||||
var lastPart = await GetFileExtensionFromMimeTypeAsync(picture.MimeType);
|
var lastPart = await GetFileExtensionFromMimeTypeAsync(picture.MimeType);
|
||||||
|
|
||||||
@ -1252,4 +1260,4 @@ public partial class PictureService : IPictureService
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user