Compare commits

...
Author SHA1 Message Date
Nikolaj 3d9a843446 Try and fix pipeline 2023-03-23 10:50:21 +01:00
Nikolaj 23ae9412f9 Bump version 2023-03-23 09:31:18 +01:00
Nikolaj 07bc3798cc Convert path to absolute 2023-03-23 09:30:52 +01:00
3 changed files with 14 additions and 8 deletions
+1 -4
View File
@@ -110,10 +110,7 @@ stages:
}
}
foreach($csproj in Get-ChildItem -Recurse -Filter *.csproj)
{
dotnet pack $csproj --configuration $(buildConfiguration) --no-build --output $(Build.ArtifactStagingDirectory)/nupkg
}
dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg
- script: |
sha="$(Build.SourceVersion)"
sha=${sha:0:7}
@@ -29,6 +29,7 @@ public sealed class RichTextEditorPastedImages
private readonly IPublishedUrlProvider _publishedUrlProvider;
private readonly IShortStringHelper _shortStringHelper;
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
private readonly string _tempFolderAbsolutePath;
public RichTextEditorPastedImages(
IUmbracoContextAccessor umbracoContextAccessor,
@@ -52,6 +53,9 @@ public sealed class RichTextEditorPastedImages
_mediaUrlGenerators = mediaUrlGenerators;
_shortStringHelper = shortStringHelper;
_publishedUrlProvider = publishedUrlProvider;
_tempFolderAbsolutePath = _hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.TempImageUploads);
}
/// <summary>
@@ -85,12 +89,14 @@ public sealed class RichTextEditorPastedImages
continue;
}
if (IsValidPath(tmpImgPath) == false)
var absoluteTempImagePath = Path.GetFullPath(_hostingEnvironment.MapPathContentRoot(tmpImgPath));
if (IsValidPath(absoluteTempImagePath) == false)
{
continue;
}
var absoluteTempImagePath = _hostingEnvironment.MapPathContentRoot(tmpImgPath);
var fileName = Path.GetFileName(absoluteTempImagePath);
var safeFileName = fileName.ToSafeFileName(_shortStringHelper);
@@ -191,5 +197,8 @@ public sealed class RichTextEditorPastedImages
return htmlDoc.DocumentNode.OuterHtml;
}
private bool IsValidPath(string imagePath) => imagePath.StartsWith(Constants.SystemDirectories.TempImageUploads);
private bool IsValidPath(string imagePath)
{
return imagePath.StartsWith(_tempFolderAbsolutePath);
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "11.2.1",
"version": "11.2.2",
"assemblyVersion": {
"precision": "build"
},