Skip to content

Commit 38a96db

Browse files
committed
Merge branch 'v13/dev' into v14/dev
# Conflicts: # src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs # src/Umbraco.Core/Models/AuditItem.cs # src/Umbraco.Core/Routing/UmbracoRequestPaths.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Infrastructure/Persistence/Repositories/Implement/AuditRepository.cs # src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs # src/Umbraco.Web.BackOffice/Controllers/ContentController.cs # src/Umbraco.Web.UI.Client/package-lock.json # src/Umbraco.Web.UI.Client/package.json # src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js # src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/common/services/user.service.js # src/Umbraco.Web.UI.Client/src/less/components/umb-media-grid.less # src/Umbraco.Web.UI.Client/src/views/components/media/umbimagepreview/umb-image-preview.html # src/Umbraco.Web.UI.Client/src/views/components/media/umbimagepreview/umbimagepreview.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js # src/Umbraco.Web.UI.Client/src/views/templates/edit.html # src/Umbraco.Web.UI.Client~HEAD # src/Umbraco.Web.UI.Login/package-lock.json # src/Umbraco.Web.UI.Login/package.json # src/Umbraco.Web.UI.Login/src/auth.element.ts # src/Umbraco.Web.UI.Login/src/components/pages/login.page.element.ts # src/Umbraco.Web.UI.Login/src/index.ts # tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts # tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UmbracoRequestPathsTests.cs
2 parents 772c523 + a1ea203 commit 38a96db

File tree

21 files changed

+282
-73
lines changed

21 files changed

+282
-73
lines changed

Directory.Packages.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,8 @@
8989
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
9090
<!-- Both OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer bring in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
9191
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.7.1" />
92+
93+
<!-- Both OpenIddict.AspNetCore, Microsoft.EntityFrameworkCore.* bring in a vulnerable version of Microsoft.Extensions.Caching.Memory -->
94+
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
9295
</ItemGroup>
9396
</Project>

src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
<!-- Both OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer bring in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
1818
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens"/>
19+
20+
<!-- Take top-level depedendency on OpenIddict.AspNetCore depends on a vulnerable version -->
21+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
1922
</ItemGroup>
2023

2124
<ItemGroup>

src/Umbraco.Cms.Persistence.EFCore/Umbraco.Cms.Persistence.EFCore.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<ItemGroup>
1212
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
1313
<PackageReference Include="Azure.Identity" />
14+
15+
<!-- Take top-level depedendency on Microsoft.Extensions.Caching.Memory, because Microsoft.EntityFrameworkCore.* depends on a vulnerable version -->
16+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
17+
1418
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
1519
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
1620
<PackageReference Include="OpenIddict.EntityFrameworkCore" />

src/Umbraco.Core/Configuration/Models/GlobalSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public string UmbracoPath
127127
/// <summary>
128128
/// Gets or sets a value indicating whether to install the database when it is missing.
129129
/// </summary>
130+
[Obsolete("This option will be removed in V16.")]
130131
[DefaultValue(StaticInstallMissingDatabase)]
131132
public bool InstallMissingDatabase { get; set; } = StaticInstallMissingDatabase;
132133

src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class RequestHandlerSettings
1515
{
1616
internal const bool StaticAddTrailingSlash = true;
1717
internal const string StaticConvertUrlsToAscii = "try";
18+
internal const string StaticConvertFileNamesToAscii = "false";
1819
internal const bool StaticEnableDefaultCharReplacements = true;
1920

2021
internal static readonly CharItem[] DefaultCharCollection =
@@ -73,6 +74,22 @@ public class RequestHandlerSettings
7374
/// </summary>
7475
public bool ShouldTryConvertUrlsToAscii => ConvertUrlsToAscii.InvariantEquals("try");
7576

77+
/// <summary>
78+
/// Gets or sets a value indicating whether to convert file names to ASCII (valid values: "true", "try" or "false").
79+
/// </summary>
80+
[DefaultValue(StaticConvertFileNamesToAscii)]
81+
public string ConvertFileNamesToAscii { get; set; } = StaticConvertFileNamesToAscii;
82+
83+
/// <summary>
84+
/// Gets a value indicating whether URLs should be converted to ASCII.
85+
/// </summary>
86+
public bool ShouldConvertFileNamesToAscii => ConvertFileNamesToAscii.InvariantEquals("true");
87+
88+
/// <summary>
89+
/// Gets a value indicating whether URLs should be tried to be converted to ASCII.
90+
/// </summary>
91+
public bool ShouldTryConvertFileNamesToAscii => ConvertFileNamesToAscii.InvariantEquals("try");
92+
7693
/// <summary>
7794
/// Disable all default character replacements
7895
/// </summary>

src/Umbraco.Core/DynamicRoot/Origin/RootDynamicRootOriginFinder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public RootDynamicRootOriginFinder(IEntityService entityService)
2727
return null;
2828
}
2929

30-
var entity = _entityService.Get(query.Context.ParentKey);
30+
// when creating new content, CurrentKey will be null - fallback to using ParentKey
31+
Guid entityKey = query.Context.CurrentKey ?? query.Context.ParentKey;
32+
var entity = _entityService.Get(entityKey);
3133

3234
if (entity is null || _allowedObjectTypes.Contains(entity.NodeObjectType) is false)
3335
{

src/Umbraco.Core/DynamicRoot/Origin/SiteDynamicRootOriginFinder.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ public SiteDynamicRootOriginFinder(IEntityService entityService, IDomainService
2020

2121
public override Guid? FindOriginKey(DynamicRootNodeQuery query)
2222
{
23-
if (query.OriginAlias != SupportedOriginType || query.Context.CurrentKey.HasValue is false)
23+
if (query.OriginAlias != SupportedOriginType)
2424
{
2525
return null;
2626
}
2727

28-
IEntitySlim? entity = _entityService.Get(query.Context.CurrentKey.Value);
28+
// when creating new content, CurrentKey will be null - fallback to using ParentKey
29+
Guid entityKey = query.Context.CurrentKey ?? query.Context.ParentKey;
30+
IEntitySlim? entity = _entityService.Get(entityKey);
2931
if (entity is null || entity.NodeObjectType != Constants.ObjectTypes.Document)
3032
{
3133
return null;

src/Umbraco.Core/Routing/UriUtility.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public Uri UriToUmbraco(Uri uri)
111111
if (path != "/")
112112
{
113113
path = path.TrimEnd(Constants.CharArrays.ForwardSlash);
114+
115+
// perform fallback to root if the path was all slashes (i.e. https://some.where//////)
116+
if (path == string.Empty)
117+
{
118+
path = "/";
119+
}
114120
}
115121

116122
return uri.Rewrite(path);

src/Umbraco.Core/Services/ContentService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,6 +2484,8 @@ public OperationResult Move(IContent content, int parentId, int userId = Constan
24842484
scope.Complete();
24852485
return OperationResult.Succeed(eventMessages);
24862486
}
2487+
2488+
return OperationResult.Succeed(eventMessages);
24872489
}
24882490

24892491
// MUST be called from within WriteLock
@@ -2724,6 +2726,9 @@ public bool RecycleBinSmells()
27242726
descendantCopy.CreatorId = userId;
27252727
descendantCopy.WriterId = userId;
27262728

2729+
// since the repository relies on the dirty state to figure out whether it needs to update the sort order, we mark it dirty here
2730+
descendantCopy.SortOrder = descendantCopy.SortOrder;
2731+
27272732
// save and flush (see above)
27282733
_documentRepository.Save(descendantCopy);
27292734

src/Umbraco.Core/Services/IContentService.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Umbraco.Cms.Core.Events;
12
using Umbraco.Cms.Core.Models;
23
using Umbraco.Cms.Core.Models.Membership;
34
using Umbraco.Cms.Core.Persistence.Querying;
@@ -315,6 +316,21 @@ public interface IContentService : IContentServiceBase<IContent>
315316
/// </summary>
316317
OperationResult Move(IContent content, int parentId, int userId = Constants.Security.SuperUserId);
317318

319+
/// <summary>
320+
/// Attempts to move the <see cref="IContent"/> <paramref name="content"/> to under the node with id <paramref name="parentId"/>.
321+
/// </summary>
322+
/// <param name="content">The <see cref="IContent"/> that shall be moved.</param>
323+
/// <param name="parentId">The id of the new parent node.</param>
324+
/// <param name="userId">Id of the user attempting to move <paramref name="content"/>.</param>
325+
/// <returns>Success if moving succeeded, otherwise Failed.</returns>
326+
[Obsolete("Adds return type to Move method. Will be removed in V14, as the original method will be adjusted.")]
327+
OperationResult
328+
AttemptMove(IContent content, int parentId, int userId = Constants.Security.SuperUserId)
329+
{
330+
Move(content, parentId, userId);
331+
return OperationResult.Succeed(new EventMessages());
332+
}
333+
318334
/// <summary>
319335
/// Copies a document.
320336
/// </summary>

0 commit comments

Comments
 (0)