Fix casing of 'URL' (#9080)

This commit is contained in:
Ronald Barendse
2020-10-05 20:48:38 +02:00
committed by GitHub
parent eaa0a3ba64
commit 2bfef74191
163 changed files with 554 additions and 554 deletions

View File

@@ -242,7 +242,7 @@ namespace Umbraco.Web.Compose
if (sender == null) throw new ArgumentNullException(nameof(sender));
if (siteUri == null)
{
_logger.Warn(typeof(Notifier), "Notifications can not be sent, no site url is set (might be during boot process?)");
_logger.Warn(typeof(Notifier), "Notifications can not be sent, no site URL is set (might be during boot process?)");
return;
}

View File

@@ -84,14 +84,14 @@ namespace Umbraco.Web
=> composition.WithCollectionBuilder<TourFilterCollectionBuilder>();
/// <summary>
/// Gets the url providers collection builder.
/// Gets the URL providers collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
public static UrlProviderCollectionBuilder UrlProviders(this Composition composition)
=> composition.WithCollectionBuilder<UrlProviderCollectionBuilder>();
/// <summary>
/// Gets the media url providers collection builder.
/// Gets the media URL providers collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
public static MediaUrlProviderCollectionBuilder MediaUrlProviders(this Composition composition)

View File

@@ -42,8 +42,8 @@ namespace Umbraco.Web.Controllers
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
// validate the redirect url
// if it's not a local url we'll redirect to the root of the current site
// validate the redirect URL
// if it's not a local URL we'll redirect to the root of the current site
return Redirect(Url.IsLocalUrl(model.RedirectUrl)
? model.RedirectUrl
: CurrentPage.AncestorOrSelf(1).Url());

View File

@@ -109,7 +109,7 @@ namespace Umbraco.Web.Editors
{
// TODO: Add 'umbracoApiControllerBaseUrl' which people can use in JS
// to prepend their URL. We could then also use this in our own resources instead of
// having each url defined here explicitly - we can do that in v8! for now
// having each URL defined here explicitly - we can do that in v8! for now
// for umbraco services we'll stick to explicitly defining the endpoints.
{"externalLoginsUrl", _urlHelper.Action("ExternalLogin", "BackOffice")},

View File

@@ -139,7 +139,7 @@ namespace Umbraco.Web.Editors
/// Used to get a specific file from disk via the FileService
/// </summary>
/// <param name="type">This is a string but will be 'scripts' 'partialViews', 'partialViewMacros' or 'stylesheets'</param>
/// <param name="virtualPath">The filename or urlencoded path of the file to open</param>
/// <param name="virtualPath">The filename or URL encoded path of the file to open</param>
/// <returns>The file and its contents from the virtualPath</returns>
public CodeFileDisplay GetByPath(string type, string virtualPath)
{
@@ -291,7 +291,7 @@ namespace Umbraco.Web.Editors
/// Used to delete a specific file from disk via the FileService
/// </summary>
/// <param name="type">This is a string but will be 'scripts' 'partialViews', 'partialViewMacros' or 'stylesheets'</param>
/// <param name="virtualPath">The filename or urlencoded path of the file to delete</param>
/// <param name="virtualPath">The filename or URL encoded path of the file to delete</param>
/// <returns>Will return a simple 200 if file deletion succeeds</returns>
[HttpDelete]
[HttpPost]

View File

@@ -207,7 +207,7 @@ namespace Umbraco.Web.Editors
}
/// <summary>
/// Gets the url of an entity
/// Gets the URL of an entity
/// </summary>
/// <param name="udi">UDI of the entity to fetch URL for</param>
/// <param name="culture">The culture to fetch the URL for</param>
@@ -236,7 +236,7 @@ namespace Umbraco.Web.Editors
}
/// <summary>
/// Gets the url of an entity
/// Gets the URL of an entity
/// </summary>
/// <param name="id">Int id of the entity to fetch URL for</param>
/// <param name="type">The type of entity such as Document, Media, Member</param>

View File

@@ -107,7 +107,7 @@ namespace Umbraco.Web.Editors
Response.Cookies.Set(new HttpCookie(Constants.Web.PreviewCookieName, previewToken));
// use a numeric url because content may not be in cache and so .Url would fail
// use a numeric URL because content may not be in cache and so .Url would fail
var query = culture.IsNullOrWhiteSpace() ? string.Empty : $"?culture={culture}";
Response.Redirect($"../../{id}.aspx{query}", true);

View File

@@ -49,7 +49,7 @@ namespace Umbraco.Web.Editors
}
/// <summary>
/// Returns a list of the sizes of gravatar urls for the user or null if the gravatar server cannot be reached
/// Returns a list of the sizes of gravatar URLs for the user or null if the gravatar server cannot be reached
/// </summary>
/// <returns></returns>
public string[] GetCurrentUserAvatarUrls()
@@ -478,7 +478,7 @@ namespace Umbraco.Web.Editors
WebUtility.UrlEncode("|"),
token.ToUrlBase64());
// Get an mvc helper to get the url
// Get an mvc helper to get the URL
var http = EnsureHttpContext();
var urlHelper = new UrlHelper(http.Request.RequestContext);
var action = urlHelper.Action("VerifyInvite", "BackOffice",

View File

@@ -26,7 +26,7 @@ namespace Umbraco.Web
/// <param name="html"></param>
/// <param name="uri"></param>
/// <param name="externalLoginsUrl">
/// The post url used to sign in with external logins - this can change depending on for what service the external login is service.
/// The post URL used to sign in with external logins - this can change depending on for what service the external login is service.
/// Example: normal back office login or authenticating upgrade login
/// </param>
/// <param name="features"></param>

View File

@@ -12,7 +12,7 @@ namespace Umbraco.Web
public static class ImageCropperTemplateCoreExtensions
{
/// <summary>
/// Gets the ImageProcessor Url by the crop alias (from the "umbracoFile" property alias) on the IPublishedContent item
/// Gets the ImageProcessor URL by the crop alias (from the "umbracoFile" property alias) on the IPublishedContent item
/// </summary>
/// <param name="mediaItem">
/// The IPublishedContent item.
@@ -21,7 +21,7 @@ namespace Umbraco.Web
/// The crop alias e.g. thumbnail
/// </param>
/// <returns>
/// The ImageProcessor.Web Url.
/// The ImageProcessor.Web URL.
/// </returns>
public static string GetCropUrl(this IPublishedContent mediaItem, string cropAlias, IImageUrlGenerator imageUrlGenerator)
{
@@ -29,7 +29,7 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the ImageProcessor Url by the crop alias using the specified property containing the image cropper Json data on the IPublishedContent item.
/// Gets the ImageProcessor URL by the crop alias using the specified property containing the image cropper Json data on the IPublishedContent item.
/// </summary>
/// <param name="mediaItem">
/// The IPublishedContent item.
@@ -41,7 +41,7 @@ namespace Umbraco.Web
/// The crop alias e.g. thumbnail
/// </param>
/// <returns>
/// The ImageProcessor.Web Url.
/// The ImageProcessor.Web URL.
/// </returns>
public static string GetCropUrl(this IPublishedContent mediaItem, string propertyAlias, string cropAlias, IImageUrlGenerator imageUrlGenerator)
{
@@ -49,7 +49,7 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the ImageProcessor Url from the IPublishedContent item.
/// Gets the ImageProcessor URL from the IPublishedContent item.
/// </summary>
/// <param name="mediaItem">
/// The IPublishedContent item.
@@ -156,10 +156,10 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the ImageProcessor Url from the image path.
/// Gets the ImageProcessor URL from the image path.
/// </summary>
/// <param name="imageUrl">
/// The image url.
/// The image URL.
/// </param>
/// <param name="width">
/// The width of the output image.
@@ -238,13 +238,13 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the ImageProcessor Url from the image path.
/// Gets the ImageProcessor URL from the image path.
/// </summary>
/// <param name="imageUrl">
/// The image url.
/// The image URL.
/// </param>
/// <param name="imageUrlGenerator">
/// The generator that will process all the options and the image URL to return a full image urls with all processing options appended
/// The generator that will process all the options and the image URL to return a full image URLs with all processing options appended
/// </param>
/// <param name="cropDataSet"></param>
/// <param name="width">

View File

@@ -13,12 +13,12 @@ using Umbraco.Web.Models;
namespace Umbraco.Web
{
/// <summary>
/// Provides extension methods for getting ImageProcessor Url from the core Image Cropper property editor
/// Provides extension methods for getting ImageProcessor URL from the core Image Cropper property editor
/// </summary>
public static class ImageCropperTemplateExtensions
{
/// <summary>
/// Gets the ImageProcessor Url by the crop alias (from the "umbracoFile" property alias) on the IPublishedContent item
/// Gets the ImageProcessor URL by the crop alias (from the "umbracoFile" property alias) on the IPublishedContent item
/// </summary>
/// <param name="mediaItem">
/// The IPublishedContent item.
@@ -27,12 +27,12 @@ namespace Umbraco.Web
/// The crop alias e.g. thumbnail
/// </param>
/// <returns>
/// The ImageProcessor.Web Url.
/// The ImageProcessor.Web URL.
/// </returns>
public static string GetCropUrl(this IPublishedContent mediaItem, string cropAlias) => ImageCropperTemplateCoreExtensions.GetCropUrl(mediaItem, cropAlias, Current.ImageUrlGenerator);
/// <summary>
/// Gets the ImageProcessor Url by the crop alias using the specified property containing the image cropper Json data on the IPublishedContent item.
/// Gets the ImageProcessor URL by the crop alias using the specified property containing the image cropper Json data on the IPublishedContent item.
/// </summary>
/// <param name="mediaItem">
/// The IPublishedContent item.
@@ -44,12 +44,12 @@ namespace Umbraco.Web
/// The crop alias e.g. thumbnail
/// </param>
/// <returns>
/// The ImageProcessor.Web Url.
/// The ImageProcessor.Web URL.
/// </returns>
public static string GetCropUrl(this IPublishedContent mediaItem, string propertyAlias, string cropAlias) => ImageCropperTemplateCoreExtensions.GetCropUrl(mediaItem, propertyAlias, cropAlias, Current.ImageUrlGenerator);
/// <summary>
/// Gets the ImageProcessor Url from the IPublishedContent item.
/// Gets the ImageProcessor URL from the IPublishedContent item.
/// </summary>
/// <param name="mediaItem">
/// The IPublishedContent item.
@@ -118,10 +118,10 @@ namespace Umbraco.Web
bool upScale = true) => ImageCropperTemplateCoreExtensions.GetCropUrl(mediaItem, Current.ImageUrlGenerator, width, height, propertyAlias, cropAlias, quality, imageCropMode, imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBuster, furtherOptions, ratioMode, upScale);
/// <summary>
/// Gets the ImageProcessor Url from the image path.
/// Gets the ImageProcessor URL from the image path.
/// </summary>
/// <param name="imageUrl">
/// The image url.
/// The image URL.
/// </param>
/// <param name="width">
/// The width of the output image.
@@ -187,10 +187,10 @@ namespace Umbraco.Web
bool upScale = true) => ImageCropperTemplateCoreExtensions.GetCropUrl(imageUrl, Current.ImageUrlGenerator, width, height, imageCropperValue, cropAlias, quality, imageCropMode, imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode, upScale);
/// <summary>
/// Gets the ImageProcessor Url from the image path.
/// Gets the ImageProcessor URL from the image path.
/// </summary>
/// <param name="imageUrl">
/// The image url.
/// The image URL.
/// </param>
/// <param name="cropDataSet"></param>
/// <param name="width">

View File

@@ -61,7 +61,7 @@ namespace Umbraco.Web.Install.Controllers
}
}
// gen the install base url
// gen the install base URL
ViewData.SetInstallApiBaseUrl(Url.GetUmbracoApiService("GetSetup", "InstallApi", "UmbracoInstall").TrimEnd("GetSetup"));
// get the base umbraco folder

View File

@@ -25,7 +25,7 @@ namespace Umbraco.Web.Media.EmbedProviders
public virtual string GetEmbedProviderUrl(string url, int maxWidth, int maxHeight)
{
if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute) == false)
throw new ArgumentException("Not a valid Url");
throw new ArgumentException("Not a valid URL.", nameof(url));
var fullUrl = new StringBuilder();

View File

@@ -27,7 +27,7 @@ namespace Umbraco.Web.Models.ContentEditing
/// <summary>
/// Path represents the path used by the backoffice tree
/// For files stored on disk, this is a urlencoded, comma separated
/// For files stored on disk, this is a URL encoded, comma separated
/// path to the file, always starting with -1.
///
/// -1,Partials,Parials%2FFolder,Partials%2FFolder%2FFile.cshtml

View File

@@ -173,7 +173,7 @@ namespace Umbraco.Web.Models.Mapping
var umbracoContext = _umbracoContextAccessor.UmbracoContext;
var urls = umbracoContext == null
? new[] { UrlInfo.Message("Cannot generate urls without a current Umbraco Context") }
? new[] { UrlInfo.Message("Cannot generate URLs without a current Umbraco Context") }
: source.GetContentUrls(_publishedRouter, umbracoContext, _localizationService, _localizedTextService, _contentService, _logger).ToArray();
return urls;

View File

@@ -9,7 +9,7 @@ namespace Umbraco.Web.Models
/// <summary>
/// Provide an abstract base class for <c>IPublishedContent</c> implementations.
/// </summary>
/// <remarks>This base class does which (a) consistently resolves and caches the Url, (b) provides an implementation
/// <remarks>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.</remarks>
[DebuggerDisplay("Content Id: {Id}")]
public abstract class PublishedContentBase : IPublishedContent

View File

@@ -165,7 +165,7 @@ namespace Umbraco.Web.Models.Trees
}
/// <summary>
/// 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
/// </summary>
/// <param name="url"></param>
/// <param name="dialogTitle"></param>

View File

@@ -64,13 +64,13 @@ namespace Umbraco.Web.Models.Trees
public string RoutePath { get; set; }
/// <summary>
/// The JSON url to load the nodes children
/// The JSON URL to load the nodes children
/// </summary>
[DataMember(Name = "childNodesUrl")]
public string ChildNodesUrl { get; set; }
/// <summary>
/// The JSON url to load the menu from
/// The JSON URL to load the menu from
/// </summary>
[DataMember(Name = "menuUrl")]
public string MenuUrl { get; set; }

View File

@@ -66,11 +66,11 @@ namespace Umbraco.Web.Mvc
//var meta = PluginController.GetMetadata(controllerType);
if (isMvc)
{
//create a new route with custom name, specified url, and the namespace of the controller plugin
//create a new route with custom name, specified URL, and the namespace of the controller plugin
controllerPluginRoute = routes.MapRoute(
//name
string.Format("umbraco-{0}-{1}", area.AreaName, controllerName),
//url format
//URL format
url,
//set the namespace of the controller to match
new[] {controllerType.Namespace});
@@ -89,7 +89,7 @@ namespace Umbraco.Web.Mvc
controllerPluginRoute = routes.MapHttpRoute(
//name
string.Format("umbraco-{0}-{1}-{2}", "api", area.AreaName, controllerName),
//url format
//URL format
url,
new {controller = controllerName, id = defaultId});
//web api routes don't set the data tokens object

View File

@@ -155,10 +155,10 @@ namespace Umbraco.Web.Mvc
};
}
/// <summary>
/// Handles a posted form to an Umbraco Url and ensures the correct controller is routed to and that
/// Handles a posted form to an Umbraco URL and ensures the correct controller is routed to and that
/// the right DataTokens are set.
/// </summary>
/// <param name="requestContext"></param>

View File

@@ -13,7 +13,7 @@ namespace Umbraco.Web.PropertyEditors
[DataEditor(
Constants.PropertyEditors.Aliases.MultiUrlPicker,
EditorType.PropertyValue,
"Multi Url Picker",
"Multi URL Picker",
"multiurlpicker",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.Pickers,

View File

@@ -141,7 +141,7 @@ namespace Umbraco.Web.PropertyEditors
QueryString = link.QueryString,
Target = link.Target,
Udi = link.Udi,
Url = link.Udi == null ? link.Url : null, // only save the url for external links
Url = link.Udi == null ? link.Url : null, // only save the URL for external links
},
new JsonSerializerSettings
{

View File

@@ -96,7 +96,7 @@ namespace Umbraco.Web.PropertyEditors
// Add the UDI to the img element as new data attribute
img.SetAttributeValue("data-udi", udi.ToString());
// Get the new persisted image url
// Get the new persisted image URL
var mediaTyped = _umbracoContextAccessor?.UmbracoContext?.Media.GetById(udi.Guid);
if (mediaTyped == null)
throw new PanicException($"Could not find media by id {udi.Guid} or there was no UmbracoContext available.");

View File

@@ -29,8 +29,8 @@ namespace Umbraco.Web.PropertyEditors
foreach (var provider in _embedCollection)
{
//Url Scheme Regex is an array of possible regex patterns to match against the URL
foreach(var urlPattern in provider.UrlSchemeRegex)
// UrlSchemeRegex is an array of possible regex patterns to match against the URL
foreach (var urlPattern in provider.UrlSchemeRegex)
{
var regexPattern = new Regex(urlPattern, RegexOptions.IgnoreCase);
if (regexPattern.IsMatch(url))
@@ -60,7 +60,7 @@ namespace Umbraco.Web.PropertyEditors
}
catch(Exception ex)
{
Logger.Error<RteEmbedController>(ex, "Error embedding url {Url} - width: {Width} height: {Height}", url, width, height);
Logger.Error<RteEmbedController>(ex, "Error embedding URL {Url} - width: {Width} height: {Height}", url, width, height);
result.OEmbedStatus = OEmbedStatus.Error;
}

View File

@@ -41,7 +41,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
if (source == null) return null;
var sourceString = source.ToString();
// ensures string is parsed for {localLink} and urls are resolved correctly
// ensures string is parsed for {localLink} and URLs are resolved correctly
sourceString = _localLinkParser.EnsureInternalLinks(sourceString, preview);
sourceString = _urlParser.EnsureUrls(sourceString);

View File

@@ -87,7 +87,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
var sourceString = source.ToString();
// ensures string is parsed for {localLink} and urls and media are resolved correctly
// ensures string is parsed for {localLink} and URLs and media are resolved correctly
sourceString = _linkParser.EnsureInternalLinks(sourceString, preview);
sourceString = _urlParser.EnsureUrls(sourceString);
sourceString = _imageSourceParser.EnsureImageSources(sourceString);

View File

@@ -39,7 +39,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
if (source == null) return null;
var sourceString = source.ToString();
// ensures string is parsed for {localLink} and urls are resolved correctly
// ensures string is parsed for {localLink} and URLs are resolved correctly
sourceString = _linkParser.EnsureInternalLinks(sourceString, preview);
sourceString = _urlParser.EnsureUrls(sourceString);

View File

@@ -109,8 +109,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
content = FollowRoute(content, parts, 1, culture);
}
// if hideTopLevelNodePath is true then for url /foo we looked for /*/foo
// but maybe that was the url of a non-default top-level node, so we also
// if hideTopLevelNodePath is true then for URL /foo we looked for /*/foo
// but maybe that was the URL of a non-default top-level node, so we also
// have to look for /foo (see note in ApplyHideTopLevelNodeFromPath).
if (content == null && hideTopLevelNode.Value && parts.Length == 1)
{
@@ -141,7 +141,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
hideTopLevelNode = hideTopLevelNode ?? HideTopLevelNodeFromPath; // default = settings
// walk up from that node until we hit a node with a domain,
// or we reach the content root, collecting urls in the way
// or we reach the content root, collecting URLs in the way
var pathParts = new List<string>();
var n = node;
var urlSegment = n.UrlSegment(culture);

View File

@@ -1333,25 +1333,25 @@ namespace Umbraco.Web
#region Url
/// <summary>
/// Gets the url of the content item.
/// Gets the URL of the content item.
/// </summary>
/// <remarks>
/// <para>If the content item is a document, then this method returns the url of the
/// document. If it is a media, then this methods return the media url for the
/// 'umbracoFile' property. Use the MediaUrl() method to get the media url for other
/// <para>If the content item is a document, then this method returns the URL of the
/// document. If it is a media, then this methods return the media URL for the
/// 'umbracoFile' property. Use the MediaUrl() method to get the media URL for other
/// properties.</para>
/// <para>The value of this property is contextual. It depends on the 'current' request uri,
/// if any. In addition, when the content type is multi-lingual, this is the url for the
/// specified culture. Otherwise, it is the invariant url.</para>
/// if any. In addition, when the content type is multi-lingual, this is the URL for the
/// specified culture. Otherwise, it is the invariant URL.</para>
/// </remarks>
public static string Url(this IPublishedContent content, string culture = null, UrlMode mode = UrlMode.Default)
{
var umbracoContext = Composing.Current.UmbracoContext;
if (umbracoContext == null)
throw new InvalidOperationException("Cannot resolve a Url when Current.UmbracoContext is null.");
throw new InvalidOperationException("Cannot resolve a URL when Current.UmbracoContext is null.");
if (umbracoContext.UrlProvider == null)
throw new InvalidOperationException("Cannot resolve a Url when Current.UmbracoContext.UrlProvider is null.");
throw new InvalidOperationException("Cannot resolve a URL when Current.UmbracoContext.UrlProvider is null.");
switch (content.ContentType.ItemType)
{

View File

@@ -193,17 +193,17 @@ namespace Umbraco.Web
#region MediaUrl
/// <summary>
/// Gets the url for a media.
/// Gets the URL for a media.
/// </summary>
/// <param name="content">The content item.</param>
/// <param name="culture">The culture (use current culture by default).</param>
/// <param name="mode">The url mode (use site configuration by default).</param>
/// <param name="mode">The URL mode (use site configuration by default).</param>
/// <param name="propertyAlias">The alias of the property (use 'umbracoFile' by default).</param>
/// <returns>The url for the media.</returns>
/// <returns>The URL for the media.</returns>
/// <remarks>
/// <para>The value of this property is contextual. It depends on the 'current' request uri,
/// if any. In addition, when the content type is multi-lingual, this is the url for the
/// specified culture. Otherwise, it is the invariant url.</para>
/// if any. In addition, when the content type is multi-lingual, this is the URL for the
/// specified culture. Otherwise, it is the invariant URL.</para>
/// </remarks>
public static string MediaUrl(this IPublishedContent content, string culture = null, UrlMode mode = UrlMode.Default, string propertyAlias = Constants.Conventions.Media.File)
{

View File

@@ -45,7 +45,7 @@ namespace Umbraco.Web
var maybeDoc = true;
var lpath = uri.AbsolutePath.ToLowerInvariant();
// handle directory-urls used for asmx
// handle directory-URLs used for asmx
// TODO: legacy - what's the point really?
var asmxPos = lpath.IndexOf(".asmx/", StringComparison.OrdinalIgnoreCase);
if (asmxPos >= 0)
@@ -124,7 +124,7 @@ namespace Umbraco.Web
return newReservedList;
});
//The url should be cleaned up before checking:
//The URL should be cleaned up before checking:
// * If it doesn't contain an '.' in the path then we assume it is a path based URL, if that is the case we should add an trailing '/' because all of our reservedPaths use a trailing '/'
// * We shouldn't be comparing the query at all
var pathPart = url.Split(new[] { '?' }, StringSplitOptions.RemoveEmptyEntries)[0].ToLowerInvariant();
@@ -133,7 +133,7 @@ namespace Umbraco.Web
pathPart = pathPart.EnsureEndsWith('/');
}
// return true if url starts with an element of the reserved list
// return true if URL starts with an element of the reserved list
return _reservedList.Any(x => pathPart.InvariantStartsWith(x));
}

View File

@@ -9,7 +9,7 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Provides urls using the <c>umbracoUrlAlias</c> property.
/// Provides URLs using the <c>umbracoUrlAlias</c> property.
/// </summary>
public class AliasUrlProvider : IUrlProvider
{
@@ -41,15 +41,15 @@ namespace Umbraco.Web.Routing
#region GetOtherUrls
/// <summary>
/// Gets the other urls of a published content.
/// Gets the other URLs of a published content.
/// </summary>
/// <param name="umbracoContext">The Umbraco context.</param>
/// <param name="id">The published content id.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The other urls for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The other URLs for the published content.</returns>
/// <remarks>
/// <para>Other urls are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// <para>Other URLs are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// </remarks>
public IEnumerable<UrlInfo> GetOtherUrls(UmbracoContext umbracoContext, int id, Uri current)
{
@@ -76,7 +76,7 @@ namespace Umbraco.Web.Routing
if (domainUris == null)
{
// no domain
// if the property is invariant, then url "/<alias>" is ok
// if the property is invariant, then URL "/<alias>" 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
@@ -98,11 +98,11 @@ namespace Umbraco.Web.Routing
}
else
{
// some domains: one url per domain, which is "<domain>/<alias>"
foreach(var domainUri in domainUris)
// some domains: one URL per domain, which is "<domain>/<alias>"
foreach (var domainUri in domainUris)
{
// if the property is invariant, get the invariant value, url is "<domain>/<invariant-alias>"
// if the property varies, get the variant value, url is "<domain>/<variant-alias>"
// if the property is invariant, get the invariant value, URL is "<domain>/<invariant-alias>"
// if the property varies, get the variant value, URL is "<domain>/<variant-alias>"
// but! only if the culture is published, else ignore
if (varies && !node.HasCulture(domainUri.Culture.Name)) continue;

View File

@@ -7,7 +7,7 @@ using Umbraco.Core.Services;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Provides an implementation of <see cref="IContentFinder"/> that handles page url rewrites
/// Provides an implementation of <see cref="IContentFinder"/> that handles page URL rewrites
/// that are stored when moving, saving, or deleting a node.
/// </summary>
/// <remarks>
@@ -48,14 +48,14 @@ namespace Umbraco.Web.Routing
var url = content == null ? "#" : content.Url(redirectUrl.Culture);
if (url.StartsWith("#"))
{
_logger.Debug<ContentFinderByRedirectUrl>("Route {Route} matches content {ContentId} which has no url.", route, redirectUrl.ContentId);
_logger.Debug<ContentFinderByRedirectUrl>("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<ContentFinderByRedirectUrl>("Route {Route} matches content {ContentId} with url '{Url}', redirecting.", route, content.Id, url);
_logger.Debug<ContentFinderByRedirectUrl>("Route {Route} matches content {ContentId} with URL '{Url}', redirecting.", route, content.Id, url);
frequest.SetRedirectPermanent(url);

View File

@@ -5,10 +5,10 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Provides an implementation of <see cref="IContentFinder"/> that handles page nice urls.
/// Provides an implementation of <see cref="IContentFinder"/> that handles page nice URLs.
/// </summary>
/// <remarks>
/// <para>Handles <c>/foo/bar</c> where <c>/foo/bar</c> is the nice url of a document.</para>
/// <para>Handles <c>/foo/bar</c> where <c>/foo/bar</c> is the nice URL of a document.</para>
/// </remarks>
public class ContentFinderByUrl : IContentFinder
{

View File

@@ -96,7 +96,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)
{

View File

@@ -9,11 +9,11 @@ using Umbraco.Core.Services;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Provides an implementation of <see cref="IContentFinder"/> that handles page nice urls and a template.
/// Provides an implementation of <see cref="IContentFinder"/> that handles page nice URLs and a template.
/// </summary>
/// <remarks>
/// <para>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</para>
/// <para>Handles <c>/foo/bar/template</c> where <c>/foo/bar</c> is the nice url of a document, and <c>template</c> a template alias.</para>
/// <para>Handles <c>/foo/bar/template</c> where <c>/foo/bar</c> is the nice URL of a document, and <c>template</c> a template alias.</para>
/// <para>If successful, then the template of the document request is also assigned.</para>
/// </remarks>
public class ContentFinderByUrlAndTemplate : ContentFinderByUrl

View File

@@ -6,7 +6,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Default media url provider.
/// Default media URL provider.
/// </summary>
public class DefaultMediaUrlProvider : IMediaUrlProvider
{

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Web.Routing
/// <inheritdoc />
public virtual UrlInfo GetUrl(UmbracoContext umbracoContext, 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));
// will not use cache if previewing
var route = umbracoContext.Content.GetRouteById(content.Id, culture);
@@ -55,7 +55,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);
@@ -66,15 +66,15 @@ namespace Umbraco.Web.Routing
#region GetOtherUrls
/// <summary>
/// Gets the other urls of a published content.
/// Gets the other URLs of a published content.
/// </summary>
/// <param name="umbracoContext">The Umbraco context.</param>
/// <param name="id">The published content id.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The other urls for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The other URLs for the published content.</returns>
/// <remarks>
/// <para>Other urls are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// <para>Other URLs are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// </remarks>
public virtual IEnumerable<UrlInfo> GetOtherUrls(UmbracoContext umbracoContext, int id, Uri current)
{
@@ -166,7 +166,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);
}

View File

@@ -4,27 +4,27 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Provides media urls.
/// Provides media URL.
/// </summary>
public interface IMediaUrlProvider
{
/// <summary>
/// Gets the url of a media item.
/// Gets the URL of a media item.
/// </summary>
/// <param name="umbracoContext">The Umbraco context.</param>
/// <param name="content">The published content.</param>
/// <param name="propertyAlias">The property alias to resolve the url from.</param>
/// <param name="mode">The url mode.</param>
/// <param name="propertyAlias">The property alias to resolve the URL from.</param>
/// <param name="mode">The URL mode.</param>
/// <param name="culture">The variation language.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The url for the media.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The URL for the media.</returns>
/// <remarks>
/// <para>The url is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the media is multi-lingual, gets the url for the specified culture or,
/// <para>The URL is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the media is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.</para>
/// <para>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.</para>
/// <para>If the provider is unable to provide a url, it returns <c>null</c>.</para>
/// <para>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.</para>
/// <para>If the provider is unable to provide a URL, it returns <c>null</c>.</para>
/// </remarks>
UrlInfo GetMediaUrl(UmbracoContext umbracoContext, IPublishedContent content, string propertyAlias, UrlMode mode, string culture, Uri current);
}

View File

@@ -5,37 +5,37 @@ using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Provides urls.
/// Provides URLs.
/// </summary>
public interface IUrlProvider
{
/// <summary>
/// Gets the url of a published content.
/// Gets the URL of a published content.
/// </summary>
/// <param name="umbracoContext">The Umbraco context.</param>
/// <param name="content">The published content.</param>
/// <param name="mode">The url mode.</param>
/// <param name="mode">The URL mode.</param>
/// <param name="culture">A culture.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The url for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The URL for the published content.</returns>
/// <remarks>
/// <para>The url is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the published content is multi-lingual, gets the url for the specified culture or,
/// <para>The URL is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the published content is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.</para>
/// <para>If the provider is unable to provide a url, it should return <c>null</c>.</para>
/// <para>If the provider is unable to provide a URL, it should return <c>null</c>.</para>
/// </remarks>
UrlInfo GetUrl(UmbracoContext umbracoContext, IPublishedContent content, UrlMode mode, string culture, Uri current);
/// <summary>
/// Gets the other urls of a published content.
/// Gets the other URLs of a published content.
/// </summary>
/// <param name="umbracoContext">The Umbraco context.</param>
/// <param name="id">The published content id.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The other urls for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The other URLs for the published content.</returns>
/// <remarks>
/// <para>Other urls are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// <para>Other URLs are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// </remarks>
IEnumerable<UrlInfo> GetOtherUrls(UmbracoContext umbracoContext, int id, Uri current);
}

View File

@@ -30,11 +30,11 @@ namespace Umbraco.Web.Routing
response.Clear();
var frequest = Current.UmbracoContext.PublishedRequest;
var reason = "Cannot render the page at url '{0}'.";
var reason = "Cannot render the page at URL '{0}'.";
if (frequest.HasPublishedContent == false)
reason = "No umbraco document matches the url '{0}'.";
reason = "No umbraco document matches the URL '{0}'.";
else if (frequest.HasTemplate == false)
reason = "No template exists to render the document at url '{0}'.";
reason = "No template exists to render the document at URL '{0}'.";
response.Write("<html><body><h1>Page not found</h1>");
response.Write("<h2>");

View File

@@ -369,14 +369,14 @@ namespace Umbraco.Web.Routing
public bool IsRedirectPermanent { get; private set; }
/// <summary>
/// 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.
/// </summary>
public string RedirectUrl { get; private set; }
/// <summary>
/// Indicates that the content request should trigger a redirect (302).
/// </summary>
/// <param name="url">The url to redirect to.</param>
/// <param name="url">The URL to redirect to.</param>
/// <remarks>Does not actually perform a redirect, only registers that the response should
/// redirect. Redirect will or will not take place in due time.</remarks>
public void SetRedirect(string url)
@@ -389,7 +389,7 @@ namespace Umbraco.Web.Routing
/// <summary>
/// Indicates that the content request should trigger a permanent redirect (301).
/// </summary>
/// <param name="url">The url to redirect to.</param>
/// <param name="url">The URL to redirect to.</param>
/// <remarks>Does not actually perform a redirect, only registers that the response should
/// redirect. Redirect will or will not take place in due time.</remarks>
public void SetRedirectPermanent(string url)
@@ -402,7 +402,7 @@ namespace Umbraco.Web.Routing
/// <summary>
/// Indicates that the content request should trigger a redirect, with a specified status code.
/// </summary>
/// <param name="url">The url to redirect to.</param>
/// <param name="url">The URL to redirect to.</param>
/// <param name="status">The status code (300-308).</param>
/// <remarks>Does not actually perform a redirect, only registers that the response should
/// redirect. Redirect will or will not take place in due time.</remarks>

View File

@@ -96,7 +96,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

View File

@@ -11,8 +11,8 @@ using Umbraco.Web.PublishedCache;
namespace Umbraco.Web.Routing
{
/// Implements an Application Event Handler for managing redirect urls tracking.
/// <para>when content is renamed or moved, we want to create a permanent 301 redirect from it's old url</para>
/// Implements an Application Event Handler for managing redirect URLs tracking.
/// <para>when content is renamed or moved, we want to create a permanent 301 redirect from it's old URL</para>
/// <para>
/// not managing domains because we don't know how to do it - changing domains => must create a higher level
/// strategy using rewriting rules probably

View File

@@ -4,10 +4,10 @@ using Umbraco.Core.Composing;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Implements an Application Event Handler for managing redirect urls tracking.
/// Implements an Application Event Handler for managing redirect URLs tracking.
/// </summary>
/// <remarks>
/// <para>when content is renamed or moved, we want to create a permanent 301 redirect from it's old url</para>
/// <para>when content is renamed or moved, we want to create a permanent 301 redirect from it's old URL</para>
/// <para>not managing domains because we don't know how to do it - changing domains => must create a higher level strategy using rewriting rules probably</para>
/// <para>recycle bin = moving to and from does nothing: to = the node is gone, where would we redirect? from = same</para>
/// </remarks>

View File

@@ -4,14 +4,14 @@ using System.Runtime.Serialization;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Represents infos for a url.
/// Represents infos for a URL.
/// </summary>
[DataContract(Name = "urlInfo", Namespace = "")]
public class UrlInfo : IEquatable<UrlInfo>
{
/// <summary>
/// Creates a <see cref="UrlInfo"/> instance representing a true url.
/// Creates a <see cref="UrlInfo"/> instance representing a true URL.
/// </summary>
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; }
/// <summary>
/// Gets a value indicating whether the url is a true url.
/// Gets a value indicating whether the URL is a true URL.
/// </summary>
/// <remarks>Otherwise, it is a message.</remarks>
[DataMember(Name = "isUrl")]
public bool IsUrl { get; }
/// <summary>
/// Gets the text, which is either the url, or a message.
/// Gets the text, which is either the URL, or a message.
/// </summary>
[DataMember(Name = "text")]
public string Text { get; }

View File

@@ -9,19 +9,19 @@ using Umbraco.Web.Composing;
namespace Umbraco.Web.Routing
{
/// <summary>
/// Provides urls.
/// Provides URLs.
/// </summary>
public class UrlProvider
{
#region Ctor and configuration
/// <summary>
/// Initializes a new instance of the <see cref="UrlProvider"/> class with an Umbraco context and a list of url providers.
/// Initializes a new instance of the <see cref="UrlProvider"/> class with an Umbraco context and a list of URL providers.
/// </summary>
/// <param name="umbracoContext">The Umbraco context.</param>
/// <param name="routingSettings">Routing settings.</param>
/// <param name="urlProviders">The list of url providers.</param>
/// <param name="mediaUrlProviders">The list of media url providers.</param>
/// <param name="urlProviders">The list of URL providers.</param>
/// <param name="mediaUrlProviders">The list of media URL providers.</param>
/// <param name="variationContextAccessor">The current variation accessor.</param>
public UrlProvider(UmbracoContext umbracoContext, IWebRoutingSection routingSettings, IEnumerable<IUrlProvider> urlProviders, IEnumerable<IMediaUrlProvider> mediaUrlProviders, IVariationContextAccessor variationContextAccessor)
{
@@ -41,11 +41,11 @@ namespace Umbraco.Web.Routing
}
/// <summary>
/// Initializes a new instance of the <see cref="UrlProvider"/> class with an Umbraco context and a list of url providers.
/// Initializes a new instance of the <see cref="UrlProvider"/> class with an Umbraco context and a list of URL providers.
/// </summary>
/// <param name="umbracoContext">The Umbraco context.</param>
/// <param name="urlProviders">The list of url providers.</param>
/// <param name="mediaUrlProviders">The list of media url providers</param>
/// <param name="urlProviders">The list of URL providers.</param>
/// <param name="mediaUrlProviders">The list of media URL providers</param>
/// <param name="variationContextAccessor">The current variation accessor.</param>
/// <param name="mode">An optional provider mode.</param>
public UrlProvider(UmbracoContext umbracoContext, IEnumerable<IUrlProvider> urlProviders, IEnumerable<IMediaUrlProvider> mediaUrlProviders, IVariationContextAccessor variationContextAccessor, UrlMode mode = UrlMode.Auto)
@@ -64,7 +64,7 @@ namespace Umbraco.Web.Routing
private readonly IVariationContextAccessor _variationContextAccessor;
/// <summary>
/// Gets or sets the provider url mode.
/// Gets or sets the provider URL mode.
/// </summary>
public UrlMode Mode { get; set; }
@@ -78,40 +78,40 @@ namespace Umbraco.Web.Routing
private IPublishedContent GetMedia(Guid id) => _umbracoContext.Media.GetById(id);
/// <summary>
/// Gets the url of a published content.
/// Gets the URL of a published content.
/// </summary>
/// <param name="id">The published content identifier.</param>
/// <param name="mode">The url mode.</param>
/// <param name="mode">The URL mode.</param>
/// <param name="culture">A culture.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The url for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The URL for the published content.</returns>
public string GetUrl(Guid id, UrlMode mode = UrlMode.Default, string culture = null, Uri current = null)
=> GetUrl(GetDocument(id), mode, culture, current);
/// <summary>
/// Gets the url of a published content.
/// Gets the URL of a published content.
/// </summary>
/// <param name="id">The published content identifier.</param>
/// <param name="mode">The url mode.</param>
/// <param name="mode">The URL mode.</param>
/// <param name="culture">A culture.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The url for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The URL for the published content.</returns>
public string GetUrl(int id, UrlMode mode = UrlMode.Default, string culture = null, Uri current = null)
=> GetUrl(GetDocument(id), mode, culture, current);
/// <summary>
/// Gets the url of a published content.
/// Gets the URL of a published content.
/// </summary>
/// <param name="content">The published content.</param>
/// <param name="mode">The url mode.</param>
/// <param name="mode">The URL mode.</param>
/// <param name="culture">A culture.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The url for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The URL for the published content.</returns>
/// <remarks>
/// <para>The url is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the published content is multi-lingual, gets the url for the specified culture or,
/// <para>The URL is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the published content is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.</para>
/// <para>If the provider is unable to provide a url, it returns "#".</para>
/// <para>If the provider is unable to provide a URL, it returns "#".</para>
/// </remarks>
public string GetUrl(IPublishedContent content, UrlMode mode = UrlMode.Default, string culture = null, Uri current = null)
{
@@ -152,14 +152,14 @@ namespace Umbraco.Web.Routing
#region GetOtherUrls
/// <summary>
/// Gets the other urls of a published content.
/// Gets the other URLs of a published content.
/// </summary>
/// <param name="id">The published content id.</param>
/// <returns>The other urls for the published content.</returns>
/// <returns>The other URLs for the published content.</returns>
/// <remarks>
/// <para>Other urls are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// <para>The results depend on the current url.</para>
/// <para>Other URLs are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// <para>The results depend on the current URL.</para>
/// </remarks>
public IEnumerable<UrlInfo> GetOtherUrls(int id)
{
@@ -167,14 +167,14 @@ namespace Umbraco.Web.Routing
}
/// <summary>
/// Gets the other urls of a published content.
/// Gets the other URLs of a published content.
/// </summary>
/// <param name="id">The published content id.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The other urls for the published content.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The other URLs for the published content.</returns>
/// <remarks>
/// <para>Other urls are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// <para>Other URLs are those that <c>GetUrl</c> would not return in the current context, but would be valid
/// URLs for the node in other contexts (different domain for current request, umbracoUrlAlias...).</para>
/// </remarks>
public IEnumerable<UrlInfo> GetOtherUrls(int id, Uri current)
{
@@ -186,7 +186,7 @@ namespace Umbraco.Web.Routing
#region GetMediaUrl
/// <summary>
/// Gets the url of a media item.
/// Gets the URL of a media item.
/// </summary>
/// <param name="id"></param>
/// <param name="mode"></param>
@@ -198,19 +198,19 @@ namespace Umbraco.Web.Routing
=> GetMediaUrl(GetMedia(id), mode, culture, propertyAlias, current);
/// <summary>
/// Gets the url of a media item.
/// Gets the URL of a media item.
/// </summary>
/// <param name="content">The published content.</param>
/// <param name="propertyAlias">The property alias to resolve the url from.</param>
/// <param name="mode">The url mode.</param>
/// <param name="propertyAlias">The property alias to resolve the URL from.</param>
/// <param name="mode">The URL mode.</param>
/// <param name="culture">The variation language.</param>
/// <param name="current">The current absolute url.</param>
/// <returns>The url for the media.</returns>
/// <param name="current">The current absolute URL.</param>
/// <returns>The URL for the media.</returns>
/// <remarks>
/// <para>The url is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the media is multi-lingual, gets the url for the specified culture or,
/// <para>The URL is absolute or relative depending on <c>mode</c> and on <c>current</c>.</para>
/// <para>If the media is multi-lingual, gets the URL for the specified culture or,
/// when no culture is specified, the current culture.</para>
/// <para>If the provider is unable to provide a url, it returns <see cref="String.Empty"/>.</para>
/// <para>If the provider is unable to provide a URL, it returns <see cref="String.Empty"/>.</para>
/// </remarks>
public string GetMediaUrl(IPublishedContent content, UrlMode mode = UrlMode.Default, string culture = null, string propertyAlias = Constants.Conventions.Media.File, Uri current = null)
{

View File

@@ -11,11 +11,11 @@ namespace Umbraco.Web.Routing
internal static class UrlProviderExtensions
{
/// <summary>
/// Gets the Urls of the content item.
/// Gets the URLs of the content item.
/// </summary>
/// <remarks>
/// <para>Use when displaying Urls. If errors occur when generating the Urls, they will show in the list.</para>
/// <para>Contains all the Urls that we can figure out (based upon domains, etc).</para>
/// <para>Use when displaying URLs. If errors occur when generating the URLs, they will show in the list.</para>
/// <para>Contains all the URLs that we can figure out (based upon domains, etc).</para>
/// </remarks>
public static IEnumerable<UrlInfo> GetContentUrls(this IContent content,
IPublishedRouter publishedRouter,
@@ -39,13 +39,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
@@ -61,7 +61,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:
@@ -72,8 +72,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 umbracoContext.UrlProvider.GetOtherUrls(content.Id).OrderBy(x => x.Text).ThenBy(x => x.Culture))
if (urls.Add(otherUrl)) //avoid duplicates
yield return otherUrl;
@@ -119,7 +119,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;
@@ -129,7 +129,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, out var urlInfo)) // detect collisions, etc
yield return urlInfo;
@@ -142,7 +142,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
@@ -163,7 +163,7 @@ namespace Umbraco.Web.Routing
private static bool DetectCollision(IContent content, string url, string culture, UmbracoContext umbracoContext, IPublishedRouter publishedRouter, ILocalizedTextService textService, 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);

View File

@@ -129,7 +129,7 @@ namespace Umbraco.Web.Runtime
if (ConfigurationManager.GetSection("system.web/httpRuntime") is HttpRuntimeSection section)
{
//set the max url length for CDF to be the smallest of the max query length, max request length
//set the max URL length for CDF to be the smallest of the max query length, max request length
ClientDependency.Core.CompositeFiles.CompositeDependencyHandler.MaxHandlerUrlLength = Math.Min(section.MaxQueryStringLength, section.MaxRequestLength);
}
@@ -208,7 +208,7 @@ namespace Umbraco.Web.Runtime
var url = umbracoPath + (meta.IsBackOffice ? "/BackOffice" : "") + "/Api/" + meta.ControllerName + "/{action}/{id}";
var route = RouteTable.Routes.MapHttpRoute(
$"umbraco-api-{meta.ControllerName}",
url, // url to match
url, // URL to match
new { controller = meta.ControllerName, id = UrlParameter.Optional },
new[] { meta.ControllerNamespace });
if (route.DataTokens == null) // web api routes don't set the data tokens object
@@ -222,7 +222,7 @@ namespace Umbraco.Web.Runtime
var url = umbracoPath + "/Surface/" + meta.ControllerName + "/{action}/{id}";
var route = RouteTable.Routes.MapRoute(
$"umbraco-surface-{meta.ControllerName}",
url, // url to match
url, // URL to match
new { controller = meta.ControllerName, action = "Index", id = UrlParameter.Optional },
new[] { meta.ControllerNamespace }); // look in this namespace to create the controller
route.DataTokens.Add(Core.Constants.Web.UmbracoDataToken, "surface"); // ensure the umbraco token is set

View File

@@ -82,7 +82,7 @@ namespace Umbraco.Web.Templates
}
/// <summary>
/// Removes media urls from &lt;img&gt; tags where a data-udi attribute is present
/// Removes media URLs from &lt;img&gt; tags where a data-udi attribute is present
/// </summary>
/// <param name="text"></param>
/// <returns></returns>

View File

@@ -47,7 +47,7 @@ namespace Umbraco.Web.Templates
if (!preview)
return EnsureInternalLinks(text);
using (_umbracoContextAccessor.UmbracoContext.ForcedPreview(preview)) // force for url provider
using (_umbracoContextAccessor.UmbracoContext.ForcedPreview(preview)) // force for URL provider
{
return EnsureInternalLinks(text);
}

View File

@@ -34,7 +34,7 @@ namespace Umbraco.Web.Templates
using (var timer = _logger.DebugDuration(typeof(IOHelper), "ResolveUrlsFromTextString starting", "ResolveUrlsFromTextString complete"))
{
// find all relative urls (ie. urls that contain ~)
// find all relative URLs (ie. URLs that contain ~)
var tags = ResolveUrlPattern.Matches(text);
_logger.Debug(typeof(IOHelper), "After regex: {Duration} matched: {TagsCount}", timer.Stopwatch.ElapsedMilliseconds, tags.Count);
foreach (Match tag in tags)
@@ -43,7 +43,7 @@ namespace Umbraco.Web.Templates
if (tag.Groups[1].Success)
url = tag.Groups[1].Value;
// The richtext editor inserts a slash in front of the url. That's why we need this little fix
// The richtext editor inserts a slash in front of the URL. That's why we need this little fix
// if (url.StartsWith("/"))
// text = text.Replace(url, ResolveUrl(url.Substring(1)));
// else

View File

@@ -45,7 +45,7 @@ namespace Umbraco.Web.Templates
if (writer == null) throw new ArgumentNullException(nameof(writer));
// instantiate a request and process
// important to use CleanedUmbracoUrl - lowercase path-only version of the current url, though this isn't going to matter
// important to use CleanedUmbracoUrl - lowercase path-only version of the current URL, though this isn't going to matter
// terribly much for this implementation since we are just creating a doc content request to modify it's properties manually.
var contentRequest = _publishedRouter.CreateRequest(_umbracoContextAccessor.UmbracoContext);

View File

@@ -22,7 +22,7 @@ namespace Umbraco.Web.Templates
[Obsolete("Inject and use an instance of " + nameof(HtmlLocalLinkParser) + " instead")]
internal static string ParseInternalLinks(string text, bool preview, UmbracoContext umbracoContext)
{
using (umbracoContext.ForcedPreview(preview)) // force for url provider
using (umbracoContext.ForcedPreview(preview)) // force for URL provider
{
text = ParseInternalLinks(text, umbracoContext.UrlProvider);
}

View File

@@ -72,7 +72,7 @@ namespace Umbraco.Web.Trees
}
else
{
// maybe we should use the guid as url param to avoid the extra call for getting dictionary item
// maybe we should use the guid as URL param to avoid the extra call for getting dictionary item
var parentDictionary = Services.LocalizationService.GetDictionaryItemById(intId.Result);
if (parentDictionary == null)
return nodes;

View File

@@ -250,7 +250,7 @@ namespace Umbraco.Web.Trees
}
/// <summary>
/// Helper method to create tree nodes and automatically generate the json url + UDI
/// Helper method to create tree nodes and automatically generate the json URL + UDI
/// </summary>
/// <param name="entity"></param>
/// <param name="entityObjectType"></param>
@@ -270,7 +270,7 @@ namespace Umbraco.Web.Trees
}
/// <summary>
/// Helper method to create tree nodes and automatically generate the json url + UDI
/// Helper method to create tree nodes and automatically generate the json URL + UDI
/// </summary>
/// <param name="entity"></param>
/// <param name="entityObjectType"></param>
@@ -289,7 +289,7 @@ namespace Umbraco.Web.Trees
}
/// <summary>
/// Helper method to create tree nodes and automatically generate the json url
/// Helper method to create tree nodes and automatically generate the json URL
/// </summary>
/// <param name="id"></param>
/// <param name="parentId"></param>
@@ -306,7 +306,7 @@ namespace Umbraco.Web.Trees
}
/// <summary>
/// Helper method to create tree nodes and automatically generate the json url
/// Helper method to create tree nodes and automatically generate the json URL
/// </summary>
/// <param name="id"></param>
/// <param name="parentId"></param>
@@ -325,7 +325,7 @@ namespace Umbraco.Web.Trees
}
/// <summary>
/// Helper method to create tree nodes and automatically generate the json url + UDI
/// Helper method to create tree nodes and automatically generate the json URL + UDI
/// </summary>
/// <param name="id"></param>
/// <param name="parentId"></param>

View File

@@ -66,7 +66,7 @@ namespace Umbraco.Web
// beware - we cannot expect a current user here, so detecting preview mode must be a lazy thing
_publishedSnapshot = new Lazy<IPublishedSnapshot>(() => publishedSnapshotService.CreatePublishedSnapshot(PreviewToken));
// set the urls...
// set the URLs...
// NOTE: The request will not be available during app startup so we can only set this to an absolute URL of localhost, this
// is a work around to being able to access the UmbracoContext during application startup and this will also ensure that people
// 'could' still generate URLs during startup BUT any domain driven URL generation will not work because it is NOT possible to get
@@ -101,7 +101,7 @@ namespace Umbraco.Web
internal Uri OriginalRequestUrl { get; }
/// <summary>
/// Gets the cleaned up url that is handled by Umbraco.
/// Gets the cleaned up URL that is handled by Umbraco.
/// </summary>
/// <remarks>That is, lowercase, no trailing slash after path, no .aspx...</remarks>
internal Uri CleanedUmbracoUrl { get; }
@@ -144,7 +144,7 @@ namespace Umbraco.Web
public bool IsFrontEndUmbracoRequest => PublishedRequest != null;
/// <summary>
/// Gets the url provider.
/// Gets the URL provider.
/// </summary>
public UrlProvider UrlProvider { get; }
@@ -197,57 +197,57 @@ namespace Umbraco.Web
#region Urls
/// <summary>
/// Gets the url of a content identified by its identifier.
/// Gets the URL of a content identified by its identifier.
/// </summary>
/// <param name="contentId">The content identifier.</param>
/// <param name="culture"></param>
/// <returns>The url for the content.</returns>
/// <returns>The URL for the content.</returns>
public string Url(int contentId, string culture = null)
{
return UrlProvider.GetUrl(contentId, culture: culture);
}
/// <summary>
/// Gets the url of a content identified by its identifier.
/// Gets the URL of a content identified by its identifier.
/// </summary>
/// <param name="contentId">The content identifier.</param>
/// <param name="culture"></param>
/// <returns>The url for the content.</returns>
/// <returns>The URL for the content.</returns>
public string Url(Guid contentId, string culture = null)
{
return UrlProvider.GetUrl(contentId, culture: culture);
}
/// <summary>
/// Gets the url of a content identified by its identifier, in a specified mode.
/// Gets the URL of a content identified by its identifier, in a specified mode.
/// </summary>
/// <param name="contentId">The content identifier.</param>
/// <param name="mode">The mode.</param>
/// <param name="culture"></param>
/// <returns>The url for the content.</returns>
/// <returns>The URL for the content.</returns>
public string Url(int contentId, UrlMode mode, string culture = null)
{
return UrlProvider.GetUrl(contentId, mode, culture);
}
/// <summary>
/// Gets the url of a content identified by its identifier, in a specified mode.
/// Gets the URL of a content identified by its identifier, in a specified mode.
/// </summary>
/// <param name="contentId">The content identifier.</param>
/// <param name="mode">The mode.</param>
/// <param name="culture"></param>
/// <returns>The url for the content.</returns>
/// <returns>The URL for the content.</returns>
public string Url(Guid contentId, UrlMode mode, string culture = null)
{
return UrlProvider.GetUrl(contentId, mode, culture);
}
/// <summary>
/// Gets the absolute url of a content identified by its identifier.
/// Gets the absolute URL of a content identified by its identifier.
/// </summary>
/// <param name="contentId">The content identifier.</param>
/// <param name="culture"></param>
/// <returns>The absolute url for the content.</returns>
/// <returns>The absolute URL for the content.</returns>
[Obsolete("Use the Url() method with UrlMode.Absolute.")]
public string UrlAbsolute(int contentId, string culture = null)
{
@@ -255,11 +255,11 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the absolute url of a content identified by its identifier.
/// Gets the absolute URL of a content identified by its identifier.
/// </summary>
/// <param name="contentId">The content identifier.</param>
/// <param name="culture"></param>
/// <returns>The absolute url for the content.</returns>
/// <returns>The absolute URL for the content.</returns>
[Obsolete("Use the Url() method with UrlMode.Absolute.")]
public string UrlAbsolute(Guid contentId, string culture = null)
{

View File

@@ -61,7 +61,7 @@ namespace Umbraco.Web
public WebSecurity Security => UmbracoContextAccessor.UmbracoContext.Security;
/// <summary>
/// Gets the Url helper.
/// Gets the URL helper.
/// </summary>
/// <remarks>This URL helper is created without any route data and an empty request context.</remarks>
public UrlHelper Url => _url ?? (_url = new UrlHelper(HttpContext.Current.Request.RequestContext));

View File

@@ -62,7 +62,7 @@ namespace Umbraco.Web
/// <param name="httpContext"></param>
private void BeginRequest(HttpContextBase httpContext)
{
// ensure application url is initialized
// ensure application URL is initialized
((RuntimeState) Current.RuntimeState).EnsureApplicationUrl(httpContext.Request);
// do not process if client-side request
@@ -128,7 +128,7 @@ namespace Umbraco.Web
// auth. Paul Sterling confirmed in Jan. 2013 that we can get rid of it.
// instantiate, prepare and process the published content request
// important to use CleanedUmbracoUrl - lowercase path-only version of the current url
// important to use CleanedUmbracoUrl - lowercase path-only version of the current URL
var request = _publishedRouter.CreateRequest(umbracoContext);
umbracoContext.PublishedRequest = request;
_publishedRouter.PrepareRequest(request);
@@ -276,7 +276,7 @@ namespace Umbraco.Web
{
// NOTE: we do not want to use TransferRequest even though many docs say it is better with IIS7, turns out this is
// not what we need. The purpose of TransferRequest is to ensure that .net processes all of the rules for the newly
// rewritten url, but this is not what we want!
// rewritten URL, but this is not what we want!
// read: http://forums.iis.net/t/1146511.aspx
var query = pcr.Uri.Query.TrimStart('?');

View File

@@ -77,7 +77,7 @@ namespace Umbraco.Web
public WebSecurity Security => UmbracoContext.Security;
/// <summary>
/// Gets the Url helper.
/// Gets the URL helper.
/// </summary>
/// <remarks>This URL helper is created without any route data and an empty request context.</remarks>
public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext));

View File

@@ -227,7 +227,7 @@ namespace Umbraco.Web
#endregion
/// <summary>
/// Returns an full url with the host, port, etc...
/// Returns an full URL with the host, port, etc...
/// </summary>
/// <param name="absolutePath">An absolute path (i.e. starts with a '/' )</param>
/// <param name="httpContext"> </param>

View File

@@ -20,7 +20,7 @@ namespace Umbraco.Web
{
/// <summary>
/// Return the Url for a Web Api service
/// Return the URL for a Web Api service
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="url"></param>
@@ -58,7 +58,7 @@ namespace Umbraco.Web
}
/// <summary>
/// Return the Url for a Web Api service
/// Return the URL for a Web Api service
/// </summary>
/// <param name="url"></param>
/// <param name="actionName"></param>
@@ -87,7 +87,7 @@ namespace Umbraco.Web
}
/// <summary>
/// Return the Url for a Web Api service
/// Return the URL for a Web Api service
/// </summary>
/// <param name="url"></param>
/// <param name="actionName"></param>
@@ -119,7 +119,7 @@ namespace Umbraco.Web
/// <summary>
/// Return the Url for an action with a cache-busting hash appended
/// Return the URL for an action with a cache-busting hash appended
/// </summary>
/// <param name="url"></param>
/// <param name="actionName"></param>

View File

@@ -23,7 +23,7 @@ namespace Umbraco.Web
#region GetCropUrl
/// <summary>
/// Gets the ImageProcessor Url of a media item by the crop alias (using default media item property alias of "umbracoFile")
/// Gets the ImageProcessor URL of a media item by the crop alias (using default media item property alias of "umbracoFile")
/// </summary>
/// <param name="urlHelper"></param>
/// <param name="mediaItem">
@@ -46,7 +46,7 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the ImageProcessor Url by the crop alias using the specified property containing the image cropper Json data on the IPublishedContent item.
/// Gets the ImageProcessor URL by the crop alias using the specified property containing the image cropper Json data on the IPublishedContent item.
/// </summary>
/// <param name="urlHelper"></param>
/// <param name="mediaItem">
@@ -63,7 +63,7 @@ namespace Umbraco.Web
/// set to false if using the result of this method for CSS.
/// </param>
/// <returns>
/// The ImageProcessor.Web Url.
/// The ImageProcessor.Web URL.
/// </returns>
public static IHtmlString GetCropUrl(this UrlHelper urlHelper, IPublishedContent mediaItem, string propertyAlias, string cropAlias, bool htmlEncode = true)
{
@@ -74,7 +74,7 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the ImageProcessor Url from the image path.
/// Gets the ImageProcessor URL from the image path.
/// </summary>
/// <param name="mediaItem">
/// The IPublishedContent item.
@@ -157,10 +157,10 @@ namespace Umbraco.Web
}
/// <summary>
/// Gets the ImageProcessor Url from the image path.
/// Gets the ImageProcessor URL from the image path.
/// </summary>
/// <param name="imageUrl">
/// The image url.
/// The image URL.
/// </param>
/// <param name="width">
/// The width of the output image.

View File

@@ -125,7 +125,7 @@ namespace Umbraco.Web.WebApi
internal IRuntimeState RuntimeState { get; }
/// <summary>
/// Gets the application url.
/// Gets the application URL.
/// </summary>
protected Uri ApplicationUrl => RuntimeState.ApplicationUrl;