Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts: # .github/workflows/codeql-analysis.yml # src/Umbraco.Core/CompositionExtensions.cs # src/Umbraco.Core/Constants-AppSettings.cs # src/Umbraco.Core/GuidUdi.cs # src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs # src/Umbraco.Core/PublishedContentExtensions.cs # src/Umbraco.Core/Routing/DefaultUrlProvider.cs # src/Umbraco.Core/Routing/UrlProvider.cs # src/Umbraco.Core/Routing/UrlProviderExtensions.cs # src/Umbraco.Core/Runtime/MainDom.cs # src/Umbraco.Core/Services/IRuntimeState.cs # src/Umbraco.Core/StringExtensions.cs # src/Umbraco.Core/Sync/ApplicationUrlHelper.cs # src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs # src/Umbraco.Core/Sync/IServerRegistrar.cs # src/Umbraco.Infrastructure/Media/EmbedProviders/Instagram.cs # src/Umbraco.Infrastructure/Models/ContentBaseExtensions.cs # src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs # src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValue.cs # src/Umbraco.Tests/Misc/ApplicationUrlHelperTests.cs # src/Umbraco.Tests/Routing/UrlProviderTests.cs # src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs # src/Umbraco.Tests/TestHelpers/TestObjects.cs # src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml # src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Rte.cshtml # src/Umbraco.Web/CompositionExtensions.cs # src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs # src/Umbraco.Web/ImageCropperTemplateExtensions.cs # src/Umbraco.Web/Models/Mapping/ContentMapDefinition.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PublishedContentExtensions.cs # src/Umbraco.Web/Runtime/WebInitialComponent.cs # src/Umbraco.Web/Runtime/WebInitialComposer.cs # src/Umbraco.Web/Templates/TemplateUtilities.cs # src/Umbraco.Web/UmbracoContext.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/UmbracoInjectedModule.cs
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Umbraco.Core.IO
|
||||
// (is used in GetRelativePath)
|
||||
private readonly string _rootPathFwd;
|
||||
|
||||
// the relative url, using url separator chars, NOT ending with a separator
|
||||
// the relative URL, using URL separator chars, NOT ending with a separator
|
||||
// eg "" or "/Views" or "/Media" or "/<vpath>/Media" in case of a virtual path
|
||||
private readonly string _rootUrl;
|
||||
|
||||
@@ -255,9 +255,9 @@ namespace Umbraco.Core.IO
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the filesystem-relative path of a full path or of an url.
|
||||
/// Gets the filesystem-relative path of a full path or of an URL.
|
||||
/// </summary>
|
||||
/// <param name="fullPathOrUrl">The full path or url.</param>
|
||||
/// <param name="fullPathOrUrl">The full path or URL.</param>
|
||||
/// <returns>The path, relative to this filesystem's root.</returns>
|
||||
/// <remarks>
|
||||
/// <para>The relative path is relative to this filesystem's root, not starting with any
|
||||
@@ -265,10 +265,10 @@ namespace Umbraco.Core.IO
|
||||
/// </remarks>
|
||||
public string GetRelativePath(string fullPathOrUrl)
|
||||
{
|
||||
// test url
|
||||
var path = fullPathOrUrl.Replace('\\', '/'); // ensure url separator char
|
||||
// test URL
|
||||
var path = fullPathOrUrl.Replace('\\', '/'); // ensure URL separator char
|
||||
|
||||
// if it starts with the root url, strip it and trim the starting slash to make it relative
|
||||
// if it starts with the root URL, strip it and trim the starting slash to make it relative
|
||||
// eg "/Media/1234/img.jpg" => "1234/img.jpg"
|
||||
if (_ioHelper.PathStartsWith(path, _rootUrl, '/'))
|
||||
return path.Substring(_rootUrl.Length).TrimStart('/');
|
||||
@@ -331,10 +331,10 @@ namespace Umbraco.Core.IO
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the url.
|
||||
/// Gets the URL.
|
||||
/// </summary>
|
||||
/// <param name="path">The filesystem-relative path.</param>
|
||||
/// <returns>The url.</returns>
|
||||
/// <returns>The URL.</returns>
|
||||
/// <remarks>All separators are forward-slashes.</remarks>
|
||||
public string GetUrl(string path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user