diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 295dc54371..f4e237a1f2 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -102,10 +102,11 @@ That said, the Umbraco development team likes to follow the hints that ReSharper
The Core Contributors team consists of one member of Umbraco HQ, [Sebastiaan](https://github.com/nul800sebastiaan), who gets assistance from the following community members who have comitted to volunteering their free time:
-- [Anders Bjerner](https://github.com/abjerner)
-- [Emma Burstow](https://github.com/emmaburstow)
-- [Poornima Nayar](https://github.com/poornimanayar)
-- [Kenn Jacobsen](https://twitter.com/KennJacobsen_DK)
+- [Nathan Woulfe](https://github.com/nathanwoulfe)
+- [Joe Glombek](https://github.com/glombek)
+- [Laura Weatherhead](https://github.com/lssweatherhead)
+- [Michael Latouche](https://github.com/mikecp)
+- [Owain Williams](https://github.com/OwainWilliams)
These wonderful people aim to provide you with a first reply to your PR, review and test out your changes and on occasions, they might ask more questions. If they are happy with your work, they'll let Umbraco HQ know by approving the PR. Hq will have final sign-off and will check the work again before it is merged.
@@ -128,7 +129,7 @@ In order to build the Umbraco source code locally, first make sure you have the
* npm v6.4.1+ (installed with Node.js)
* [Git command line](https://git-scm.com/download/)
-The easiest way to get started is to open `src\umbraco.sln` in Visual Studio 2017 (version 15.9.7 or higher, [the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects). In Visual Studio, find the Task Runner Explorer (in the View menu under Other Windows) and run the build task under the gulpfile.
+The easiest way to get started is to open `src\umbraco.sln` in Visual Studio 2019 (version 16.3 or higher, [the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects). In Visual Studio, find the Task Runner Explorer (in the View menu under Other Windows) and run the build task under the gulpfile.
Alternatively, you can run `build.ps1` from the Powershell command line, which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `gulp dev` in `src\Umbraco.Web.UI.Client`. See [this page](BUILD.md) for more details.
diff --git a/.github/ISSUE_TEMPLATE/4_Support_question.md b/.github/ISSUE_TEMPLATE/4_Support_question.md
deleted file mode 100644
index 829df982f9..0000000000
--- a/.github/ISSUE_TEMPLATE/4_Support_question.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-name: ⁉️ Support Question
-about: Having trouble with Umbraco? -> https://our.umbraco.com
----
-
-This issue tracker is NOT meant for support questions. If you have a question,
-please join us on the forum at https://our.umbraco.com.
-
-Thanks!
diff --git a/.github/ISSUE_TEMPLATE/5_Documentation_issue.md b/.github/ISSUE_TEMPLATE/5_Documentation_issue.md
deleted file mode 100644
index 8893647aa8..0000000000
--- a/.github/ISSUE_TEMPLATE/5_Documentation_issue.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-name: 📖 Documentation Issue
-about: See https://github.com/umbraco/UmbracoDocs/issues for documentation issues
----
-
-The Umbraco documentation has its own dedicated repository. Please open your
-documentation-related issue at https://github.com/umbraco/UmbracoDocs/issues
-
-Thanks!
diff --git a/.github/ISSUE_TEMPLATE/6_Security_issue.md b/.github/ISSUE_TEMPLATE/6_Security_issue.md
deleted file mode 100644
index 84c5f5989c..0000000000
--- a/.github/ISSUE_TEMPLATE/6_Security_issue.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-name: 🔐 Security Issue
-about: Discovered a Security Issue in Umbraco?
----
-
-⚠️ PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, SEE BELOW.
-
-If you have found a security issue in Umbraco, please send the details to
-security@umbraco.com and don't disclose it publicly until we can provide a fix for
-it. If you wish, we'll credit you for finding verified issues, when we release
-the patched version.
-
-❗ Please read more about how to report security issues on https://umbraco.com/security
-
-A note on "Self XSS"
---------------------
-
-Umbraco is a CMS, that allows users to edit content on a website. As such,
-all _authenticated users_ can:
-
- - Edit content, and (depending on the field types) insert HTML and CSS in that
- content, with a variety of allowed attributes.
- - Depending on the user level: Edit template files, and insert C#, HTML, CSS and
- javascript in so on.
- - Upload files to the site, which will become publicly available.
-
-We see these functionalities as _features_, and not as security issues. Please
-report the mentioned items only if they can be performed by non-authorized
-users, or other exploitable vulnerabilities.
-
-Thanks!
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..37d1be9158
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,11 @@
+blank_issues_enabled: true
+contact_links:
+ - name: ⁉️ Support Question
+ url: https://our.umbraco.com
+ about: This issue tracker is NOT meant for support questions. If you have a question, please join us on the forum.
+ - name: 📖 Documentation Issue
+ url: https://github.com/umbraco/UmbracoDocs/issues
+ about: Documentation issues should be reported on the Umbraco documentation repository.
+ - name: 🔐 Security Issue
+ url: https://umbraco.com/about-us/trust-center/security-and-umbraco/how-to-report-a-vulnerability-in-umbraco/
+ about: Discovered a Security Issue in Umbraco?
\ No newline at end of file
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000000..4dfa5a83b9
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,61 @@
+name: "Code scanning - action"
+
+on:
+ push:
+ branches: [v8/contrib,v8/dev,v8/bug,v8/feature]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ schedule:
+ - cron: '0 7 * * 2'
+
+jobs:
+ CodeQL-Build:
+
+ runs-on: windows-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ # We must fetch at least the immediate parents so that if this is
+ # a pull request then we can checkout the head.
+ fetch-depth: 2
+
+ # If this run was triggered by a pull request event, then checkout
+ # the head of the pull request instead of the merge commit.
+ - run: git checkout HEAD^2
+ if: ${{ github.event_name == 'pull_request' }}
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ # Override language selection by uncommenting this and choosing your languages
+ # with:
+ # languages: go, javascript, csharp, python, cpp, java
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 https://git.io/JvXDl
+
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
+
+ - name: configure Pagefile
+ uses: al-cheb/configure-pagefile-action@v1.2
+ with:
+ minimum-size: 8GB
+ maximum-size: 32GB
+
+ - run: |
+ echo "Run Umbraco-CMS build"
+ pwsh -command .\build\build.ps1
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
+ with:
+ config-file: ./.github/codeql-config.yml
+
+
diff --git a/.github/workflows/codeql-config.yml b/.github/workflows/codeql-config.yml
new file mode 100644
index 0000000000..59b55e48ec
--- /dev/null
+++ b/.github/workflows/codeql-config.yml
@@ -0,0 +1,13 @@
+name: "CodeQL config"
+on:
+ push:
+ branches: [v8/contrib,v8/dev]
+paths-ignore:
+ - node_modules
+ - Umbraco.TestData
+ - Umbraco.Tests
+ - Umbraco.Tests.AcceptanceTest
+ - Umbraco.Tests.Benchmarks
+ - bin
+paths:
+ - src
\ No newline at end of file
diff --git a/src/Umbraco.Configuration/Legacy/GlobalSettings.cs b/src/Umbraco.Configuration/Legacy/GlobalSettings.cs
index fabe95f5bd..e6363047a5 100644
--- a/src/Umbraco.Configuration/Legacy/GlobalSettings.cs
+++ b/src/Umbraco.Configuration/Legacy/GlobalSettings.cs
@@ -100,9 +100,9 @@ namespace Umbraco.Core.Configuration.Legacy
}
///
- /// Gets the reserved urls from web.config.
+ /// Gets the reserved URLs from web.config.
///
- /// The reserved urls.
+ /// The reserved URLs.
public string ReservedUrls
{
get
@@ -253,10 +253,10 @@ namespace Umbraco.Core.Configuration.Legacy
}
///
- /// Gets a value indicating whether umbraco should hide top level nodes from generated urls.
+ /// Gets a value indicating whether umbraco should hide top level nodes from generated URLs.
///
///
- /// true if umbraco hides top level nodes from urls; otherwise, false.
+ /// true if umbraco hides top level nodes from URLs; otherwise, false.
///
public bool HideTopLevelNodeFromPath
{
diff --git a/src/Umbraco.Core/CompositionExtensions.cs b/src/Umbraco.Core/CompositionExtensions.cs
index bbea868f55..05249b15dc 100644
--- a/src/Umbraco.Core/CompositionExtensions.cs
+++ b/src/Umbraco.Core/CompositionExtensions.cs
@@ -62,7 +62,7 @@ namespace Umbraco.Core
=> composition.WithCollectionBuilder();
///
- /// Gets the url providers collection builder.
+ /// Gets the URL providers collection builder.
///
/// The composition.
public static UrlProviderCollectionBuilder UrlProviders(this Composition composition)
diff --git a/src/Umbraco.Core/Configuration/IGlobalSettings.cs b/src/Umbraco.Core/Configuration/IGlobalSettings.cs
index 26d833613f..ab74171472 100644
--- a/src/Umbraco.Core/Configuration/IGlobalSettings.cs
+++ b/src/Umbraco.Core/Configuration/IGlobalSettings.cs
@@ -9,9 +9,9 @@
// our config classes should be named according to what they are configuring.
///
- /// Gets the reserved urls from web.config.
+ /// Gets the reserved URLs from web.config.
///
- /// The reserved urls.
+ /// The reserved URLs.
string ReservedUrls { get; }
///
@@ -43,10 +43,10 @@
string DefaultUILanguage { get; }
///
- /// Gets a value indicating whether umbraco should hide top level nodes from generated urls.
+ /// Gets a value indicating whether umbraco should hide top level nodes from generated URLs.
///
///
- /// true if umbraco hides top level nodes from urls; otherwise, false.
+ /// true if umbraco hides top level nodes from URLs; otherwise, false.
///
bool HideTopLevelNodeFromPath { get; }
diff --git a/src/Umbraco.Core/Constants-AppSettings.cs b/src/Umbraco.Core/Constants-AppSettings.cs
index 5e9039043d..2c83226061 100644
--- a/src/Umbraco.Core/Constants-AppSettings.cs
+++ b/src/Umbraco.Core/Constants-AppSettings.cs
@@ -101,7 +101,7 @@ namespace Umbraco.Core
public const string DefaultUILanguage = "Umbraco.Core.DefaultUILanguage";
///
- /// A true/false value indicating whether umbraco should hide top level nodes from generated urls.
+ /// A true/false value indicating whether umbraco should hide top level nodes from generated URLs.
///
public const string HideTopLevelNodeFromPath = "Umbraco.Core.HideTopLevelNodeFromPath";
diff --git a/src/Umbraco.Core/Constants-PropertyEditors.cs b/src/Umbraco.Core/Constants-PropertyEditors.cs
index cadd710275..eb24cf4229 100644
--- a/src/Umbraco.Core/Constants-PropertyEditors.cs
+++ b/src/Umbraco.Core/Constants-PropertyEditors.cs
@@ -192,7 +192,7 @@ namespace Umbraco.Core
public const string NestedContent = "Umbraco.NestedContent";
///
- /// Alias for the multi url picker editor.
+ /// Alias for the multi URL picker editor.
///
public const string MultiUrlPicker = "Umbraco.MultiUrlPicker";
}
diff --git a/src/Umbraco.Core/GuidUdi.cs b/src/Umbraco.Core/GuidUdi.cs
index 8acac61b32..08dad39f12 100644
--- a/src/Umbraco.Core/GuidUdi.cs
+++ b/src/Umbraco.Core/GuidUdi.cs
@@ -34,7 +34,7 @@ namespace Umbraco.Core
{
Guid guid;
if (Guid.TryParse(uriValue.AbsolutePath.TrimStart('/'), out guid) == false)
- throw new FormatException("Url \"" + uriValue + "\" is not a guid entity id.");
+ throw new FormatException("URI \"" + uriValue + "\" is not a GUID entity ID.");
Guid = guid;
}
diff --git a/src/Umbraco.Core/IO/IFileSystem.cs b/src/Umbraco.Core/IO/IFileSystem.cs
index 0405c5925a..9de1ea40f2 100644
--- a/src/Umbraco.Core/IO/IFileSystem.cs
+++ b/src/Umbraco.Core/IO/IFileSystem.cs
@@ -102,7 +102,7 @@ namespace Umbraco.Core.IO
///
/// Returns the application relative path to the file.
///
- /// The full path or url.
+ /// The full path or URL.
///
/// The representing the relative path.
///
@@ -118,11 +118,11 @@ namespace Umbraco.Core.IO
string GetFullPath(string path);
///
- /// Returns the application relative url to the file.
+ /// Returns the application relative URL to the file.
///
- /// The path to return the url for.
+ /// The path to return the URL for.
///
- /// representing the relative url.
+ /// representing the relative URL.
///
string GetUrl(string path);
diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs
index 403557958a..df9e335726 100644
--- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs
+++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs
@@ -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 "//Media" in case of a virtual path
private readonly string _rootUrl;
@@ -255,9 +255,9 @@ namespace Umbraco.Core.IO
}
///
- /// 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.
///
- /// The full path or url.
+ /// The full path or URL.
/// The path, relative to this filesystem's root.
///
/// The relative path is relative to this filesystem's root, not starting with any
@@ -265,10 +265,10 @@ namespace Umbraco.Core.IO
///
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
}
///
- /// Gets the url.
+ /// Gets the URL.
///
/// The filesystem-relative path.
- /// The url.
+ /// The URL.
/// All separators are forward-slashes.
public string GetUrl(string path)
{
diff --git a/src/Umbraco.Core/Logging/LoggingTaskExtension.cs b/src/Umbraco.Core/Logging/LoggingTaskExtension.cs
index 1f742133c3..2e3aa0a883 100644
--- a/src/Umbraco.Core/Logging/LoggingTaskExtension.cs
+++ b/src/Umbraco.Core/Logging/LoggingTaskExtension.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading;
using System.Threading.Tasks;
namespace Umbraco.Core.Logging
@@ -14,7 +15,12 @@ namespace Umbraco.Core.Logging
///
public static Task LogErrors(this Task task, Action logMethod)
{
- return task.ContinueWith(t => LogErrorsInner(t, logMethod), TaskContinuationOptions.OnlyOnFaulted);
+ return task.ContinueWith(
+ t => LogErrorsInner(t, logMethod),
+ CancellationToken.None,
+ TaskContinuationOptions.OnlyOnFaulted,
+ // Must explicitly specify this, see https://blog.stephencleary.com/2013/10/continuewith-is-dangerous-too.html
+ TaskScheduler.Default);
}
///
@@ -26,7 +32,10 @@ namespace Umbraco.Core.Logging
///
public static Task LogErrorsWaitable(this Task task, Action logMethod)
{
- return task.ContinueWith(t => LogErrorsInner(t, logMethod));
+ return task.ContinueWith(
+ t => LogErrorsInner(t, logMethod),
+ // Must explicitly specify this, see https://blog.stephencleary.com/2013/10/continuewith-is-dangerous-too.html
+ TaskScheduler.Default);
}
private static void LogErrorsInner(Task task, Action logAction)
diff --git a/src/Umbraco.Core/Media/IEmbedProvider.cs b/src/Umbraco.Core/Media/IEmbedProvider.cs
index 99b162e0b7..39da6fae0d 100644
--- a/src/Umbraco.Core/Media/IEmbedProvider.cs
+++ b/src/Umbraco.Core/Media/IEmbedProvider.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Media
string[] UrlSchemeRegex { get; }
///
- /// A collection of querystring request parameters to append to the API Url
+ /// A collection of querystring request parameters to append to the API URL
///
/// ?key=value&key2=value2
Dictionary RequestParams { get; }
diff --git a/src/Umbraco.Core/Models/Entities/IMediaEntitySlim.cs b/src/Umbraco.Core/Models/Entities/IMediaEntitySlim.cs
index 9440000146..f7daf79ec9 100644
--- a/src/Umbraco.Core/Models/Entities/IMediaEntitySlim.cs
+++ b/src/Umbraco.Core/Models/Entities/IMediaEntitySlim.cs
@@ -7,7 +7,7 @@
{
///
- /// The media file's path/url
+ /// The media file's path/URL
///
string MediaPath { get; }
}
diff --git a/src/Umbraco.Core/Models/IRedirectUrl.cs b/src/Umbraco.Core/Models/IRedirectUrl.cs
index e066881645..527dad57da 100644
--- a/src/Umbraco.Core/Models/IRedirectUrl.cs
+++ b/src/Umbraco.Core/Models/IRedirectUrl.cs
@@ -5,7 +5,7 @@ using Umbraco.Core.Models.Entities;
namespace Umbraco.Core.Models
{
///
- /// Represents a redirect url.
+ /// Represents a redirect URL.
///
public interface IRedirectUrl : IEntity, IRememberBeingDirty
{
@@ -22,7 +22,7 @@ namespace Umbraco.Core.Models
Guid ContentKey { get; set; }
///
- /// Gets or sets the redirect url creation date.
+ /// Gets or sets the redirect URL creation date.
///
[DataMember]
DateTime CreateDateUtc { get; set; }
@@ -34,7 +34,7 @@ namespace Umbraco.Core.Models
string Culture { get; set; }
///
- /// Gets or sets the redirect url route.
+ /// Gets or sets the redirect URL route.
///
/// Is a proper Umbraco route eg /path/to/foo or 123/path/tofoo.
[DataMember]
diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
index 4872d04321..f8784973b7 100644
--- a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Models.PublishedContent
string Name { get; }
///
- /// Gets the url segment of the content item for the current culture.
+ /// Gets the URL segment of the content item for the current culture.
///
string UrlSegment { get; }
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentBase.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentBase.cs
index 57c116dc54..02912a6f8e 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentBase.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentBase.cs
@@ -9,7 +9,7 @@ namespace Umbraco.Web.Models
///
/// Provide an abstract base class for IPublishedContent implementations.
///
- /// This base class does which (a) consistently resolves and caches the Url, (b) provides an implementation
+ /// This base class does which (a) consistently resolves and caches the URL, (b) provides an implementation
/// for this[alias], and (c) provides basic content set management.
[DebuggerDisplay("Content Id: {Id}")]
public abstract class PublishedContentBase : IPublishedContent
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedCultureInfos.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedCultureInfos.cs
index 495faa6bf3..8cf159ac60 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedCultureInfos.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedCultureInfos.cs
@@ -32,7 +32,7 @@ namespace Umbraco.Core.Models.PublishedContent
public string Name { get; }
///
- /// Gets the url segment of the item.
+ /// Gets the URL segment of the item.
///
public string UrlSegment { get; }
diff --git a/src/Umbraco.Core/Models/PublishedContent/UrlMode.cs b/src/Umbraco.Core/Models/PublishedContent/UrlMode.cs
index 4cd6a680f4..d11459bb9e 100644
--- a/src/Umbraco.Core/Models/PublishedContent/UrlMode.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/UrlMode.cs
@@ -1,27 +1,27 @@
namespace Umbraco.Core.Models.PublishedContent
{
///
- /// Specifies the type of urls that the url provider should produce, Auto is the default.
+ /// Specifies the type of URLs that the URL provider should produce, Auto is the default.
///
public enum UrlMode
{
///
- /// Indicates that the url provider should do what it has been configured to do.
+ /// Indicates that the URL provider should do what it has been configured to do.
///
Default = 0,
///
- /// Indicates that the url provider should produce relative urls exclusively.
+ /// Indicates that the URL provider should produce relative URLs exclusively.
///
Relative,
///
- /// Indicates that the url provider should produce absolute urls exclusively.
+ /// Indicates that the URL provider should produce absolute URLs exclusively.
///
Absolute,
///
- /// Indicates that the url provider should determine automatically whether to return relative or absolute urls.
+ /// Indicates that the URL provider should determine automatically whether to return relative or absolute URLs.
///
Auto
}
diff --git a/src/Umbraco.Core/Models/ServerRegistration.cs b/src/Umbraco.Core/Models/ServerRegistration.cs
index 7dae5d5393..a862b11c23 100644
--- a/src/Umbraco.Core/Models/ServerRegistration.cs
+++ b/src/Umbraco.Core/Models/ServerRegistration.cs
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Models
/// Initializes a new instance of the class.
///
/// The unique id of the server registration.
- /// The server url.
+ /// The server URL.
/// The unique server identity.
/// The date and time the registration was created.
/// The date and time the registration was last accessed.
@@ -45,7 +45,7 @@ namespace Umbraco.Core.Models
///
/// Initializes a new instance of the class.
///
- /// The server url.
+ /// The server URL.
/// The unique server identity.
/// The date and time the registration was created.
public ServerRegistration(string serverAddress, string serverIdentity, DateTime registered)
@@ -58,7 +58,7 @@ namespace Umbraco.Core.Models
}
///
- /// Gets or sets the server url.
+ /// Gets or sets the server URL.
///
public string ServerAddress
{
diff --git a/src/Umbraco.Core/Models/Trees/MenuItem.cs b/src/Umbraco.Core/Models/Trees/MenuItem.cs
index 094c6b24ff..fb4dfb836c 100644
--- a/src/Umbraco.Core/Models/Trees/MenuItem.cs
+++ b/src/Umbraco.Core/Models/Trees/MenuItem.cs
@@ -165,7 +165,7 @@ namespace Umbraco.Web.Models.Trees
}
///
- /// Sets the menu item to display a dialog based on a url path in an iframe
+ /// Sets the menu item to display a dialog based on a URL path in an iframe
///
///
///
diff --git a/src/Umbraco.Core/Persistence/Repositories/IRedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IRedirectUrlRepository.cs
index d05f4e007c..36f885520d 100644
--- a/src/Umbraco.Core/Persistence/Repositories/IRedirectUrlRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/IRedirectUrlRepository.cs
@@ -10,72 +10,80 @@ namespace Umbraco.Core.Persistence.Repositories
public interface IRedirectUrlRepository : IReadWriteQueryRepository
{
///
- /// Gets a redirect url.
+ /// Gets a redirect URL.
///
- /// The Umbraco redirect url route.
+ /// The Umbraco redirect URL route.
/// The content unique key.
/// The culture.
///
IRedirectUrl Get(string url, Guid contentKey, string culture);
///
- /// Deletes a redirect url.
+ /// Deletes a redirect URL.
///
- /// The redirect url identifier.
+ /// The redirect URL identifier.
void Delete(Guid id);
///
- /// Deletes all redirect urls.
+ /// Deletes all redirect URLs.
///
void DeleteAll();
///
- /// Deletes all redirect urls for a given content.
+ /// Deletes all redirect URLs for a given content.
///
/// The content unique key.
void DeleteContentUrls(Guid contentKey);
///
- /// Gets the most recent redirect url corresponding to an Umbraco redirect url route.
+ /// Gets the most recent redirect URL corresponding to an Umbraco redirect URL route.
///
- /// The Umbraco redirect url route.
- /// The most recent redirect url corresponding to the route.
+ /// The Umbraco redirect URL route.
+ /// The most recent redirect URL corresponding to the route.
IRedirectUrl GetMostRecentUrl(string url);
///
- /// Gets all redirect urls for a content item.
+ /// Gets the most recent redirect URL corresponding to an Umbraco redirect URL route.
+ ///
+ /// The Umbraco redirect URL route.
+ /// The culture the domain is associated with
+ /// The most recent redirect URL corresponding to the route.
+ IRedirectUrl GetMostRecentUrl(string url, string culture);
+
+ ///
+ /// Gets all redirect URLs for a content item.
///
/// The content unique key.
- /// All redirect urls for the content item.
+ /// All redirect URLs for the content item.
IEnumerable GetContentUrls(Guid contentKey);
///
- /// Gets all redirect urls.
+ /// Gets all redirect URLs.
///
/// The page index.
/// The page size.
- /// The total count of redirect urls.
- /// The redirect urls.
+ /// The total count of redirect URLs.
+ /// The redirect URLs.
IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total);
///
- /// Gets all redirect urls below a given content item.
+ /// Gets all redirect URLs below a given content item.
///
/// The content unique identifier.
/// The page index.
/// The page size.
- /// The total count of redirect urls.
- /// The redirect urls.
+ /// The total count of redirect URLs.
+ /// The redirect URLs.
IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total);
///
- /// Searches for all redirect urls that contain a given search term in their URL property.
+ /// Searches for all redirect URLs that contain a given search term in their URL property.
///
/// The term to search for.
/// The page index.
/// The page size.
- /// The total count of redirect urls.
- /// The redirect urls.
+ /// The total count of redirect URLs.
+ /// The redirect URLs.
IEnumerable SearchUrls(string searchTerm, long pageIndex, int pageSize, out long total);
}
}
diff --git a/src/Umbraco.Core/PublishedContentExtensions.cs b/src/Umbraco.Core/PublishedContentExtensions.cs
index 03ce0c066a..684b4bc850 100644
--- a/src/Umbraco.Core/PublishedContentExtensions.cs
+++ b/src/Umbraco.Core/PublishedContentExtensions.cs
@@ -40,11 +40,11 @@ namespace Umbraco.Core
#region Url segment
///
- /// Gets the url segment of the content item.
+ /// Gets the URL segment of the content item.
///
/// The content item.
///
- /// The specific culture to get the url segment for. If null is used the current culture is used (Default is null).
+ /// The specific culture to get the URL segment for. If null is used the current culture is used (Default is null).
public static string UrlSegment(this IPublishedContent content, IVariationContextAccessor variationContextAccessor, string culture = null)
{
// invariant has invariant value (whatever the requested culture)
@@ -824,7 +824,7 @@ namespace Umbraco.Core
/// The content item.
///
///
- /// The specific culture to get the url children for. Default is null which will use the current culture in
+ /// The specific culture to get the URL children for. Default is null which will use the current culture in
///
///
/// Gets children that are available for the specified culture.
diff --git a/src/Umbraco.Core/Routing/AliasUrlProvider.cs b/src/Umbraco.Core/Routing/AliasUrlProvider.cs
index e71de2f6c6..71fe0f7e28 100644
--- a/src/Umbraco.Core/Routing/AliasUrlProvider.cs
+++ b/src/Umbraco.Core/Routing/AliasUrlProvider.cs
@@ -9,7 +9,7 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
///
- /// Provides urls using the umbracoUrlAlias property.
+ /// Provides URLs using the umbracoUrlAlias property.
///
public class AliasUrlProvider : IUrlProvider
{
@@ -47,15 +47,15 @@ namespace Umbraco.Web.Routing
#region GetOtherUrls
///
- /// Gets the other urls of a published content.
+ /// Gets the other URLs of a published content.
///
/// The Umbraco context.
/// The published content id.
- /// The current absolute url.
- /// The other urls for the published content.
+ /// The current absolute URL.
+ /// The other URLs for the published content.
///
- /// Other urls are those that GetUrl would not return in the current context, but would be valid
- /// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).
+ /// Other URLs are those that GetUrl would not return in the current context, but would be valid
+ /// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).
///
public IEnumerable GetOtherUrls(int id, Uri current)
{
@@ -83,7 +83,7 @@ namespace Umbraco.Web.Routing
if (domainUris == null)
{
// no domain
- // if the property is invariant, then url "/" is ok
+ // if the property is invariant, then URL "/" is ok
// if the property varies, then what are we supposed to do?
// the content finder may work, depending on the 'current' culture,
// but there's no way we can return something meaningful here
@@ -105,11 +105,11 @@ namespace Umbraco.Web.Routing
}
else
{
- // some domains: one url per domain, which is "/"
- foreach(var domainUri in domainUris)
+ // some domains: one URL per domain, which is "/"
+ foreach (var domainUri in domainUris)
{
- // if the property is invariant, get the invariant value, url is "/"
- // if the property varies, get the variant value, url is "/"
+ // if the property is invariant, get the invariant value, URL is "/"
+ // if the property varies, get the variant value, URL is "/"
// but! only if the culture is published, else ignore
if (varies && !node.HasCulture(domainUri.Culture.Name)) continue;
diff --git a/src/Umbraco.Core/Routing/ContentFinderByRedirectUrl.cs b/src/Umbraco.Core/Routing/ContentFinderByRedirectUrl.cs
index 5b3e0a5d99..d7fd770c4f 100644
--- a/src/Umbraco.Core/Routing/ContentFinderByRedirectUrl.cs
+++ b/src/Umbraco.Core/Routing/ContentFinderByRedirectUrl.cs
@@ -7,7 +7,7 @@ using Umbraco.Core.Services;
namespace Umbraco.Web.Routing
{
///
- /// Provides an implementation of that handles page url rewrites
+ /// Provides an implementation of that handles page URL rewrites
/// that are stored when moving, saving, or deleting a node.
///
///
@@ -38,7 +38,9 @@ namespace Umbraco.Web.Routing
? frequest.Domain.ContentId + DomainUtilities.PathRelativeToDomain(frequest.Domain.Uri, frequest.Uri.GetAbsolutePathDecoded())
: frequest.Uri.GetAbsolutePathDecoded();
- var redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(route);
+
+
+ var redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(route, frequest.Culture.Name);
if (redirectUrl == null)
{
@@ -50,14 +52,14 @@ namespace Umbraco.Web.Routing
var url = content == null ? "#" : content.Url(_publishedUrlProvider, redirectUrl.Culture);
if (url.StartsWith("#"))
{
- _logger.Debug("Route {Route} matches content {ContentId} which has no url.", route, redirectUrl.ContentId);
+ _logger.Debug("Route {Route} matches content {ContentId} which has no URL.", route, redirectUrl.ContentId);
return false;
}
- // Appending any querystring from the incoming request to the redirect url.
+ // Appending any querystring from the incoming request to the redirect URL
url = string.IsNullOrEmpty(frequest.Uri.Query) ? url : url + frequest.Uri.Query;
- _logger.Debug("Route {Route} matches content {ContentId} with url '{Url}', redirecting.", route, content.Id, url);
+ _logger.Debug("Route {Route} matches content {ContentId} with URL '{Url}', redirecting.", route, content.Id, url);
frequest.SetRedirectPermanent(url);
diff --git a/src/Umbraco.Core/Routing/ContentFinderByUrl.cs b/src/Umbraco.Core/Routing/ContentFinderByUrl.cs
index 3fcffff842..b41f59e17e 100644
--- a/src/Umbraco.Core/Routing/ContentFinderByUrl.cs
+++ b/src/Umbraco.Core/Routing/ContentFinderByUrl.cs
@@ -5,10 +5,10 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
///
- /// Provides an implementation of that handles page nice urls.
+ /// Provides an implementation of that handles page nice URLs.
///
///
- /// Handles /foo/bar where /foo/bar is the nice url of a document.
+ /// Handles /foo/bar where /foo/bar is the nice URL of a document.
///
public class ContentFinderByUrl : IContentFinder
{
diff --git a/src/Umbraco.Core/Routing/ContentFinderByUrlAlias.cs b/src/Umbraco.Core/Routing/ContentFinderByUrlAlias.cs
index 6bc1b329ed..8e1de88cbc 100644
--- a/src/Umbraco.Core/Routing/ContentFinderByUrlAlias.cs
+++ b/src/Umbraco.Core/Routing/ContentFinderByUrlAlias.cs
@@ -100,7 +100,7 @@ namespace Umbraco.Web.Routing
}
// TODO: even with Linq, what happens below has to be horribly slow
- // but the only solution is to entirely refactor url providers to stop being dynamic
+ // but the only solution is to entirely refactor URL providers to stop being dynamic
if (rootNodeId > 0)
{
diff --git a/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs b/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs
index 7bcea4681e..cbe7fbae09 100644
--- a/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs
+++ b/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs
@@ -7,11 +7,11 @@ using Umbraco.Core.Services;
namespace Umbraco.Web.Routing
{
///
- /// Provides an implementation of that handles page nice urls and a template.
+ /// Provides an implementation of that handles page nice URLs and a template.
///
///
/// This finder allows for an odd routing pattern similar to altTemplate, probably only use case is if there is an alternative mime type template and it should be routable by something like "/hello/world/json" where the JSON template is to be used for the "world" page
- /// Handles /foo/bar/template where /foo/bar is the nice url of a document, and template a template alias.
+ /// Handles /foo/bar/template where /foo/bar is the nice URL of a document, and template a template alias.
/// If successful, then the template of the document request is also assigned.
///
public class ContentFinderByUrlAndTemplate : ContentFinderByUrl
diff --git a/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs b/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs
index 3e6413ff90..e489b764c3 100644
--- a/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs
+++ b/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs
@@ -5,7 +5,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.Routing
{
///
- /// Default media url provider.
+ /// Default media URL provider.
///
public class DefaultMediaUrlProvider : IMediaUrlProvider
{
diff --git a/src/Umbraco.Core/Routing/DefaultUrlProvider.cs b/src/Umbraco.Core/Routing/DefaultUrlProvider.cs
index f56d96b6b3..dcbb922a7a 100644
--- a/src/Umbraco.Core/Routing/DefaultUrlProvider.cs
+++ b/src/Umbraco.Core/Routing/DefaultUrlProvider.cs
@@ -34,7 +34,7 @@ namespace Umbraco.Web.Routing
///
public virtual UrlInfo GetUrl(IPublishedContent content, UrlMode mode, string culture, Uri current)
{
- if (!current.IsAbsoluteUri) throw new ArgumentException("Current url must be absolute.", nameof(current));
+ if (!current.IsAbsoluteUri) throw new ArgumentException("Current URL must be absolute.", nameof(current));
var umbracoContext = _umbracoContextAccessor.UmbracoContext;
// will not use cache if previewing
@@ -59,7 +59,7 @@ namespace Umbraco.Web.Routing
? null
: DomainUtilities.DomainForNode(umbracoContext.PublishedSnapshot.Domains, _siteDomainHelper, int.Parse(route.Substring(0, pos)), current, culture);
- // assemble the url from domainUri (maybe null) and path
+ // assemble the URL from domainUri (maybe null) and path
var url = AssembleUrl(domainUri, path, current, mode).ToString();
return UrlInfo.Url(url, culture);
@@ -70,15 +70,15 @@ namespace Umbraco.Web.Routing
#region GetOtherUrls
///
- /// Gets the other urls of a published content.
+ /// Gets the other URLs of a published content.
///
/// The Umbraco context.
/// The published content id.
- /// The current absolute url.
- /// The other urls for the published content.
+ /// The current absolute URL.
+ /// The other URLs for the published content.
///
- /// Other urls are those that GetUrl would not return in the current context, but would be valid
- /// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).
+ /// Other URLs are those that GetUrl would not return in the current context, but would be valid
+ /// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).
///
public virtual IEnumerable GetOtherUrls(int id, Uri current)
{
@@ -171,7 +171,7 @@ namespace Umbraco.Web.Routing
}
// UriFromUmbraco will handle vdir
- // meaning it will add vdir into domain urls too!
+ // meaning it will add vdir into domain URLs too!
return _uriUtility.UriFromUmbraco(uri, _globalSettings, _requestSettings);
}
diff --git a/src/Umbraco.Core/Routing/IMediaUrlProvider.cs b/src/Umbraco.Core/Routing/IMediaUrlProvider.cs
index 1b966c6fdd..6da917fe25 100644
--- a/src/Umbraco.Core/Routing/IMediaUrlProvider.cs
+++ b/src/Umbraco.Core/Routing/IMediaUrlProvider.cs
@@ -5,26 +5,26 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
///
- /// Provides media urls.
+ /// Provides media URL.
///
public interface IMediaUrlProvider
{
///
- /// Gets the url of a media item.
+ /// Gets the URL of a media item.
///
/// The published content.
- /// The property alias to resolve the url from.
- /// The url mode.
+ /// The property alias to resolve the URL from.
+ /// The URL mode.
/// The variation language.
- /// The current absolute url.
- /// The url for the media.
+ /// The current absolute URL.
+ /// The URL for the media.
///
- /// The url is absolute or relative depending on mode and on current.
- /// If the media is multi-lingual, gets the url for the specified culture or,
+ /// The URL is absolute or relative depending on mode and on current.
+ /// If the media is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.
- /// The url provider can ignore the mode and always return an absolute url,
- /// e.g. a cdn url provider will most likely always return an absolute url.
- /// If the provider is unable to provide a url, it returns null.
+ /// The URL provider can ignore the mode and always return an absolute URL,
+ /// e.g. a cdn URL provider will most likely always return an absolute URL.
+ /// If the provider is unable to provide a URL, it returns null.
///
UrlInfo GetMediaUrl(IPublishedContent content, string propertyAlias, UrlMode mode, string culture, Uri current);
}
diff --git a/src/Umbraco.Core/Routing/IUrlProvider.cs b/src/Umbraco.Core/Routing/IUrlProvider.cs
index ba1d48a113..8fa96c7a2d 100644
--- a/src/Umbraco.Core/Routing/IUrlProvider.cs
+++ b/src/Umbraco.Core/Routing/IUrlProvider.cs
@@ -5,35 +5,35 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
///
- /// Provides urls.
+ /// Provides URLs.
///
public interface IUrlProvider
{
///
- /// Gets the url of a published content.
+ /// Gets the URL of a published content.
///
/// The published content.
- /// The url mode.
+ /// The URL mode.
/// A culture.
- /// The current absolute url.
- /// The url for the published content.
+ /// The current absolute URL.
+ /// The URL for the published content.
///
- /// The url is absolute or relative depending on mode and on current.
- /// If the published content is multi-lingual, gets the url for the specified culture or,
+ /// The URL is absolute or relative depending on mode and on current.
+ /// If the published content is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.
- /// If the provider is unable to provide a url, it should return null.
+ /// If the provider is unable to provide a URL, it should return null.
///
UrlInfo GetUrl(IPublishedContent content, UrlMode mode, string culture, Uri current);
///
- /// Gets the other urls of a published content.
+ /// Gets the other URLs of a published content.
///
/// The published content id.
- /// The current absolute url.
- /// The other urls for the published content.
+ /// The current absolute URL.
+ /// The other URLs for the published content.
///
- /// Other urls are those that GetUrl would not return in the current context, but would be valid
- /// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).
+ /// Other URLs are those that GetUrl would not return in the current context, but would be valid
+ /// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).
///
IEnumerable GetOtherUrls(int id, Uri current);
}
diff --git a/src/Umbraco.Core/Routing/PublishedRequest.cs b/src/Umbraco.Core/Routing/PublishedRequest.cs
index 6e4d0008a9..7abf42a4e6 100644
--- a/src/Umbraco.Core/Routing/PublishedRequest.cs
+++ b/src/Umbraco.Core/Routing/PublishedRequest.cs
@@ -370,14 +370,14 @@ namespace Umbraco.Web.Routing
public bool IsRedirectPermanent { get; private set; }
///
- /// Gets or sets the url to redirect to, when the content request triggers a redirect.
+ /// Gets or sets the URL to redirect to, when the content request triggers a redirect.
///
public string RedirectUrl { get; private set; }
///
/// Indicates that the content request should trigger a redirect (302).
///
- /// The url to redirect to.
+ /// The URL to redirect to.
/// Does not actually perform a redirect, only registers that the response should
/// redirect. Redirect will or will not take place in due time.
public void SetRedirect(string url)
@@ -390,7 +390,7 @@ namespace Umbraco.Web.Routing
///
/// Indicates that the content request should trigger a permanent redirect (301).
///
- /// The url to redirect to.
+ /// The URL to redirect to.
/// Does not actually perform a redirect, only registers that the response should
/// redirect. Redirect will or will not take place in due time.
public void SetRedirectPermanent(string url)
@@ -403,7 +403,7 @@ namespace Umbraco.Web.Routing
///
/// Indicates that the content request should trigger a redirect, with a specified status code.
///
- /// The url to redirect to.
+ /// The URL to redirect to.
/// The status code (300-308).
/// Does not actually perform a redirect, only registers that the response should
/// redirect. Redirect will or will not take place in due time.
diff --git a/src/Umbraco.Core/Routing/PublishedRouter.cs b/src/Umbraco.Core/Routing/PublishedRouter.cs
index 1a422dea92..f5b08d5e12 100644
--- a/src/Umbraco.Core/Routing/PublishedRouter.cs
+++ b/src/Umbraco.Core/Routing/PublishedRouter.cs
@@ -108,7 +108,7 @@ namespace Umbraco.Web.Routing
{
// note - at that point the original legacy module did something do handle IIS custom 404 errors
// ie pages looking like /anything.aspx?404;/path/to/document - I guess the reason was to support
- // "directory urls" without having to do wildcard mapping to ASP.NET on old IIS. This is a pain
+ // "directory URLs" without having to do wildcard mapping to ASP.NET on old IIS. This is a pain
// to maintain and probably not used anymore - removed as of 06/2012. @zpqrtbnk.
//
// to trigger Umbraco's not-found, one should configure IIS and/or ASP.NET custom 404 errors
diff --git a/src/Umbraco.Core/Routing/UriUtility.cs b/src/Umbraco.Core/Routing/UriUtility.cs
index 0c68580204..22d0e28b38 100644
--- a/src/Umbraco.Core/Routing/UriUtility.cs
+++ b/src/Umbraco.Core/Routing/UriUtility.cs
@@ -181,7 +181,7 @@ namespace Umbraco.Web
///
- /// Returns an full url with the host, port, etc...
+ /// Returns an full URL with the host, port, etc...
///
/// An absolute path (i.e. starts with a '/' )
///
diff --git a/src/Umbraco.Core/Routing/UrlInfo.cs b/src/Umbraco.Core/Routing/UrlInfo.cs
index 8385ab54a9..59145d19ec 100644
--- a/src/Umbraco.Core/Routing/UrlInfo.cs
+++ b/src/Umbraco.Core/Routing/UrlInfo.cs
@@ -4,14 +4,14 @@ using System.Runtime.Serialization;
namespace Umbraco.Web.Routing
{
///
- /// Represents infos for a url.
+ /// Represents infos for a URL.
///
[DataContract(Name = "urlInfo", Namespace = "")]
public class UrlInfo : IEquatable
{
///
- /// Creates a instance representing a true url.
+ /// Creates a instance representing a true URL.
///
public static UrlInfo Url(string text, string culture = null) => new UrlInfo(text, true, culture);
@@ -38,14 +38,14 @@ namespace Umbraco.Web.Routing
public string Culture { get; }
///
- /// Gets a value indicating whether the url is a true url.
+ /// Gets a value indicating whether the URL is a true URL.
///
/// Otherwise, it is a message.
[DataMember(Name = "isUrl")]
public bool IsUrl { get; }
///
- /// Gets the text, which is either the url, or a message.
+ /// Gets the text, which is either the URL, or a message.
///
[DataMember(Name = "text")]
public string Text { get; }
diff --git a/src/Umbraco.Core/Routing/UrlProvider.cs b/src/Umbraco.Core/Routing/UrlProvider.cs
index fa764cf7ff..3866d978f7 100644
--- a/src/Umbraco.Core/Routing/UrlProvider.cs
+++ b/src/Umbraco.Core/Routing/UrlProvider.cs
@@ -9,19 +9,19 @@ namespace Umbraco.Web.Routing
{
///
- /// Provides urls.
+ /// Provides URLs.
///
public class UrlProvider : IPublishedUrlProvider
{
#region Ctor and configuration
///
- /// Initializes a new instance of the class with an Umbraco context and a list of url providers.
+ /// Initializes a new instance of the class with an Umbraco context and a list of URL providers.
///
/// The Umbraco context accessor.
/// Routing settings.
- /// The list of url providers.
- /// The list of media url providers.
+ /// The list of URL providers.
+ /// The list of media URL providers.
/// The current variation accessor.
///
public UrlProvider(IUmbracoContextAccessor umbracoContextAccessor, IWebRoutingSettings routingSettings, UrlProviderCollection urlProviders, MediaUrlProviderCollection mediaUrlProviders, IVariationContextAccessor variationContextAccessor)
@@ -48,7 +48,7 @@ namespace Umbraco.Web.Routing
private readonly IVariationContextAccessor _variationContextAccessor;
///
- /// Gets or sets the provider url mode.
+ /// Gets or sets the provider URL mode.
///
public UrlMode Mode { get; set; }
@@ -61,40 +61,40 @@ namespace Umbraco.Web.Routing
private IPublishedContent GetMedia(Guid id) => _umbracoContextAccessor.UmbracoContext.Media.GetById(id);
///
- /// Gets the url of a published content.
+ /// Gets the URL of a published content.
///
/// The published content identifier.
- /// The url mode.
+ /// The URL mode.
/// A culture.
- /// The current absolute url.
- /// The url for the published content.
+ /// The current absolute URL.
+ /// The URL for the published content.
public string GetUrl(Guid id, UrlMode mode = UrlMode.Default, string culture = null, Uri current = null)
=> GetUrl(GetDocument(id), mode, culture, current);
///
- /// Gets the url of a published content.
+ /// Gets the URL of a published content.
///
/// The published content identifier.
- /// The url mode.
+ /// The URL mode.
/// A culture.
- /// The current absolute url.
- /// The url for the published content.
+ /// The current absolute URL.
+ /// The URL for the published content.
public string GetUrl(int id, UrlMode mode = UrlMode.Default, string culture = null, Uri current = null)
=> GetUrl(GetDocument(id), mode, culture, current);
///
- /// Gets the url of a published content.
+ /// Gets the URL of a published content.
///
/// The published content.
- /// The url mode.
+ /// The URL mode.
/// A culture.
- /// The current absolute url.
- /// The url for the published content.
+ /// The current absolute URL.
+ /// The URL for the published content.
///
- /// The url is absolute or relative depending on mode and on current.
- /// If the published content is multi-lingual, gets the url for the specified culture or,
+ /// The URL is absolute or relative depending on mode and on current.
+ /// If the published content is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.
- /// If the provider is unable to provide a url, it returns "#".
+ /// If the provider is unable to provide a URL, it returns "#".
///
public string GetUrl(IPublishedContent content, UrlMode mode = UrlMode.Default, string culture = null, Uri current = null)
{
@@ -135,14 +135,14 @@ namespace Umbraco.Web.Routing
#region GetOtherUrls
///
- /// Gets the other urls of a published content.
+ /// Gets the other URLs of a published content.
///
/// The published content id.
- /// The other urls for the published content.
+ /// The other URLs for the published content.
///
- /// Other urls are those that GetUrl would not return in the current context, but would be valid
- /// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).
- /// The results depend on the current url.
+ /// Other URLs are those that GetUrl would not return in the current context, but would be valid
+ /// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).
+ /// The results depend on the current URL.
///
public IEnumerable GetOtherUrls(int id)
{
@@ -150,14 +150,14 @@ namespace Umbraco.Web.Routing
}
///
- /// Gets the other urls of a published content.
+ /// Gets the other URLs of a published content.
///
/// The published content id.
- /// The current absolute url.
- /// The other urls for the published content.
+ /// The current absolute URL.
+ /// The other URLs for the published content.
///
- /// Other urls are those that GetUrl would not return in the current context, but would be valid
- /// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).
+ /// Other URLs are those that GetUrl would not return in the current context, but would be valid
+ /// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).
///
public IEnumerable GetOtherUrls(int id, Uri current)
{
@@ -169,7 +169,7 @@ namespace Umbraco.Web.Routing
#region GetMediaUrl
///
- /// Gets the url of a media item.
+ /// Gets the URL of a media item.
///
///
///
@@ -181,19 +181,19 @@ namespace Umbraco.Web.Routing
=> GetMediaUrl(GetMedia(id), mode, culture, propertyAlias, current);
///
- /// Gets the url of a media item.
+ /// Gets the URL of a media item.
///
/// The published content.
- /// The property alias to resolve the url from.
- /// The url mode.
+ /// The property alias to resolve the URL from.
+ /// The URL mode.
/// The variation language.
- /// The current absolute url.
- /// The url for the media.
+ /// The current absolute URL.
+ /// The URL for the media.
///
- /// The url is absolute or relative depending on mode and on current.
- /// If the media is multi-lingual, gets the url for the specified culture or,
+ /// The URL is absolute or relative depending on mode and on current.
+ /// If the media is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.
- /// If the provider is unable to provide a url, it returns .
+ /// If the provider is unable to provide a URL, it returns .
///
public string GetMediaUrl(IPublishedContent content, UrlMode mode = UrlMode.Default, string culture = null, string propertyAlias = Constants.Conventions.Media.File, Uri current = null)
{
diff --git a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs
index a7f8a97c6d..209ae64714 100644
--- a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs
+++ b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs
@@ -12,11 +12,11 @@ namespace Umbraco.Web.Routing
internal static class UrlProviderExtensions
{
///
- /// Gets the Urls of the content item.
+ /// Gets the URLs of the content item.
///
///
- /// Use when displaying Urls. If errors occur when generating the Urls, they will show in the list.
- /// Contains all the Urls that we can figure out (based upon domains, etc).
+ /// Use when displaying URLs. If errors occur when generating the URLs, they will show in the list.
+ /// Contains all the URLs that we can figure out (based upon domains, etc).
///
public static IEnumerable GetContentUrls(this IContent content,
IPublishedRouter publishedRouter,
@@ -46,13 +46,13 @@ namespace Umbraco.Web.Routing
yield break;
}
- // build a list of urls, for the back-office
+ // build a list of URLs, for the back-office
// which will contain
- // - the 'main' urls, which is what .Url would return, for each culture
- // - the 'other' urls we know (based upon domains, etc)
+ // - the 'main' URLs, which is what .Url would return, for each culture
+ // - the 'other' URLs we know (based upon domains, etc)
//
// need to work through each installed culture:
- // on invariant nodes, each culture returns the same url segment but,
+ // on invariant nodes, each culture returns the same URL segment but,
// we don't know if the branch to this content is invariant, so we need to ask
// for URLs for all cultures.
// and, not only for those assigned to domains in the branch, because we want
@@ -68,7 +68,7 @@ namespace Umbraco.Web.Routing
urls.Add(cultureUrl);
}
- //return the real urls first, then the messages
+ //return the real URLs first, then the messages
foreach (var urlGroup in urls.GroupBy(x => x.IsUrl).OrderByDescending(x => x.Key))
{
//in some cases there will be the same URL for multiple cultures:
@@ -79,8 +79,8 @@ namespace Umbraco.Web.Routing
yield return dUrl;
}
- // get the 'other' urls - ie not what you'd get with GetUrl() but urls that would route to the document, nevertheless.
- // for these 'other' urls, we don't check whether they are routable, collide, anything - we just report them.
+ // get the 'other' URLs - ie not what you'd get with GetUrl() but URLs that would route to the document, nevertheless.
+ // for these 'other' URLs, we don't check whether they are routable, collide, anything - we just report them.
foreach (var otherUrl in publishedUrlProvider.GetOtherUrls(content.Id).OrderBy(x => x.Text).ThenBy(x => x.Culture))
if (urls.Add(otherUrl)) //avoid duplicates
yield return otherUrl;
@@ -129,7 +129,7 @@ namespace Umbraco.Web.Routing
switch (url)
{
- // deal with 'could not get the url'
+ // deal with 'could not get the URL'
case "#":
yield return HandleCouldNotGetUrl(content, culture, contentService, textService);
break;
@@ -139,7 +139,7 @@ namespace Umbraco.Web.Routing
yield return UrlInfo.Message(textService.Localize("content/getUrlException"), culture);
break;
- // got a url, deal with collisions, add url
+ // got a URL, deal with collisions, add URL
default:
if (DetectCollision(content, url, culture, umbracoContext, publishedRouter, textService, variationContextAccessor, uriUtility, out var urlInfo)) // detect collisions, etc
yield return urlInfo;
@@ -152,7 +152,7 @@ namespace Umbraco.Web.Routing
private static UrlInfo HandleCouldNotGetUrl(IContent content, string culture, IContentService contentService, ILocalizedTextService textService)
{
- // document has a published version yet its url is "#" => a parent must be
+ // document has a published version yet its URL is "#" => a parent must be
// unpublished, walk up the tree until we find it, and report.
var parent = content;
do
@@ -173,7 +173,7 @@ namespace Umbraco.Web.Routing
private static bool DetectCollision(IContent content, string url, string culture, IUmbracoContext umbracoContext, IPublishedRouter publishedRouter, ILocalizedTextService textService, IVariationContextAccessor variationContextAccessor, UriUtility uriUtility, out UrlInfo urlInfo)
{
- // test for collisions on the 'main' url
+ // test for collisions on the 'main' URL
var uri = new Uri(url.TrimEnd('/'), UriKind.RelativeOrAbsolute);
if (uri.IsAbsoluteUri == false) uri = uri.MakeAbsolute(umbracoContext.CleanedUmbracoUrl);
uri = uriUtility.UriToUmbraco(uri);
diff --git a/src/Umbraco.Core/Runtime/MainDom.cs b/src/Umbraco.Core/Runtime/MainDom.cs
index 81db1b700d..028198666c 100644
--- a/src/Umbraco.Core/Runtime/MainDom.cs
+++ b/src/Umbraco.Core/Runtime/MainDom.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Security.Cryptography;
using System.Threading;
using Umbraco.Core.Hosting;
+using System.Threading.Tasks;
using Umbraco.Core.Logging;
namespace Umbraco.Core.Runtime
@@ -37,6 +38,9 @@ namespace Umbraco.Core.Runtime
private const int LockTimeoutMilliseconds = 40000; // 40 seconds
+ private Task _listenTask;
+ private Task _listenCompleteTask;
+
#endregion
#region Ctor
@@ -172,7 +176,13 @@ namespace Umbraco.Core.Runtime
try
{
// Listen for the signal from another AppDomain coming online to release the lock
- _mainDomLock.ListenAsync().ContinueWith(_ => OnSignal("signal"));
+ _listenTask = _mainDomLock.ListenAsync();
+ _listenCompleteTask = _listenTask.ContinueWith(t =>
+ {
+ _logger.Debug("Listening task completed with {TaskStatus}", _listenTask.Status);
+
+ OnSignal("signal");
+ }, TaskScheduler.Default); // Must explicitly specify this, see https://blog.stephencleary.com/2013/10/continuewith-is-dangerous-too.html
}
catch (OperationCanceledException ex)
{
diff --git a/src/Umbraco.Core/Scheduling/TaskAndFactoryExtensions.cs b/src/Umbraco.Core/Scheduling/TaskAndFactoryExtensions.cs
index 7220e77e0c..557fe37709 100644
--- a/src/Umbraco.Core/Scheduling/TaskAndFactoryExtensions.cs
+++ b/src/Umbraco.Core/Scheduling/TaskAndFactoryExtensions.cs
@@ -8,6 +8,7 @@ namespace Umbraco.Web.Scheduling
{
#region Task Extensions
+ // TODO: Not used, is this used in Deploy or something?
static void SetCompletionSource(TaskCompletionSource completionSource, Task task)
{
if (task.IsFaulted)
@@ -16,6 +17,7 @@ namespace Umbraco.Web.Scheduling
completionSource.SetResult(default(TResult));
}
+ // TODO: Not used, is this used in Deploy or something?
static void SetCompletionSource(TaskCompletionSource completionSource, Task task)
{
if (task.IsFaulted)
@@ -24,17 +26,33 @@ namespace Umbraco.Web.Scheduling
completionSource.SetResult(task.Result);
}
+ // TODO: Not used, is this used in Deploy or something?
public static Task ContinueWithTask(this Task task, Func continuation)
{
var completionSource = new TaskCompletionSource