Merge branch 'netcore/dev' into netcore/feature/AB4234-Move-Indentity-struff-to-web

This commit is contained in:
Shannon
2020-01-14 12:41:58 +11:00
93 changed files with 8 additions and 173 deletions

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models
{

View File

@@ -1,10 +1,9 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Xml;
using Umbraco.Core.Media;
@@ -19,7 +18,7 @@ namespace Umbraco.Web.Media.EmbedProviders
public abstract string[] UrlSchemeRegex { get; }
public abstract Dictionary<string, string> RequestParams { get; }
public abstract string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0);
public virtual string GetEmbedProviderUrl(string url, int maxWidth, int maxHeight)
@@ -30,7 +29,7 @@ namespace Umbraco.Web.Media.EmbedProviders
var fullUrl = new StringBuilder();
fullUrl.Append(ApiEndpoint);
fullUrl.Append("?url=" + HttpUtility.UrlEncode(url));
fullUrl.Append("?url=" + WebUtility.UrlEncode(url));
foreach (var param in RequestParams)
fullUrl.Append($"&{param.Key}={param.Value}");
@@ -43,7 +42,7 @@ namespace Umbraco.Web.Media.EmbedProviders
return fullUrl.ToString();
}
public virtual string DownloadResponse(string url)
{
if (_httpClient == null)

View File

@@ -13,7 +13,7 @@ namespace Umbraco.Web.Media
/// <summary>
/// Provides methods to manage auto-fill properties for upload fields.
/// </summary>
internal class UploadAutoFillProperties
public class UploadAutoFillProperties
{
private readonly IMediaFileSystem _mediaFileSystem;
private readonly ILogger _logger;
@@ -40,7 +40,7 @@ namespace Umbraco.Web.Media
ResetProperties(content, autoFillConfig, culture, segment);
}
/// <summary>
/// Populates the auto-fill properties of a content item, for a specified auto-fill configuration.
/// </summary>

View File

@@ -26,6 +26,7 @@
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Map" Version="1.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,70 +0,0 @@
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Composing;
using Umbraco.Web.PropertyEditors;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.Routing;
using File = System.IO.File;
namespace Umbraco.Web.Templates
{
[Obsolete("This class is obsolete, all methods have been moved to other classes: " + nameof(HtmlLocalLinkParser) + ", " + nameof(HtmlUrlParser) + " and " + nameof(HtmlImageSourceParser))]
public static class TemplateUtilities
{
// TODO: Replace mediaCache with media url provider
internal static string ParseInternalLinks(string text, UrlProvider urlProvider, IPublishedMediaCache mediaCache)
{
if (urlProvider == null) throw new ArgumentNullException(nameof(urlProvider));
if (mediaCache == null) throw new ArgumentNullException(nameof(mediaCache));
// Parse internal links
var tags = HtmlLocalLinkParser.LocalLinkPattern.Matches(text);
foreach (Match tag in tags)
{
if (tag.Groups.Count > 0)
{
var id = tag.Groups[1].Value; //.Remove(tag.Groups[1].Value.Length - 1, 1);
//The id could be an int or a UDI
if (UdiParser.TryParse(id, out var udi))
{
var guidUdi = udi as GuidUdi;
if (guidUdi != null)
{
var newLink = "#";
if (guidUdi.EntityType == Constants.UdiEntityType.Document)
newLink = urlProvider.GetUrl(guidUdi.Guid);
else if (guidUdi.EntityType == Constants.UdiEntityType.Media)
newLink = mediaCache.GetById(guidUdi.Guid)?.Url;
if (newLink == null)
newLink = "#";
text = text.Replace(tag.Value, "href=\"" + newLink);
}
}
if (int.TryParse(id, out var intId))
{
var newLink = urlProvider.GetUrl(intId);
text = text.Replace(tag.Value, "href=\"" + newLink);
}
}
}
return text;
}
}
}

View File

@@ -182,60 +182,6 @@
<Compile Include="Logging\WebProfilerComposer.cs" />
<Compile Include="Logging\WebProfilerProvider.cs" />
<Compile Include="Macros\IMacroRenderer.cs" />
<Compile Include="Media\EmbedProviders\Giphy.cs" />
<Compile Include="Media\EmbedProviders\YouTube.cs" />
<Compile Include="Media\EmbedProviders\EmbedProviderBase.cs" />
<Compile Include="Media\EmbedProviders\EmbedProvidersCollection.cs" />
<Compile Include="Media\EmbedProviders\EmbedProvidersCollectionBuilder.cs" />
<Compile Include="Media\EmbedProviders\Flickr.cs" />
<Compile Include="Media\EmbedProviders\GettyImages.cs" />
<Compile Include="Media\EmbedProviders\DailyMotion.cs" />
<Compile Include="Media\EmbedProviders\SoundCloud.cs" />
<Compile Include="Media\EmbedProviders\Hulu.cs" />
<Compile Include="Media\EmbedProviders\Ted.cs" />
<Compile Include="Media\EmbedProviders\Issuu.cs" />
<Compile Include="Media\EmbedProviders\Vimeo.cs" />
<Compile Include="Media\EmbedProviders\Twitter.cs" />
<Compile Include="Media\EmbedProviders\Kickstarter.cs" />
<Compile Include="Media\EmbedProviders\OEmbedResponse.cs" />
<Compile Include="Media\EmbedProviders\Instagram.cs" />
<Compile Include="Media\EmbedProviders\Slideshare.cs" />
<Compile Include="Media\Exif\BitConverterEx.cs" />
<Compile Include="Media\Exif\ExifBitConverter.cs" />
<Compile Include="Media\Exif\ExifEnums.cs" />
<Compile Include="Media\Exif\ExifExceptions.cs" />
<Compile Include="Media\Exif\ExifExtendedProperty.cs" />
<Compile Include="Media\Exif\ExifFileTypeDescriptor.cs" />
<Compile Include="Media\Exif\ExifInterOperability.cs" />
<Compile Include="Media\Exif\ExifProperty.cs" />
<Compile Include="Media\Exif\ExifPropertyCollection.cs" />
<Compile Include="Media\Exif\ExifPropertyFactory.cs" />
<Compile Include="Media\Exif\ExifTag.cs" />
<Compile Include="Media\Exif\ExifTagFactory.cs" />
<Compile Include="Media\Exif\IFD.cs" />
<Compile Include="Media\Exif\ImageFile.cs" />
<Compile Include="Media\Exif\ImageFileDirectory.cs" />
<Compile Include="Media\Exif\ImageFileDirectoryEntry.cs" />
<Compile Include="Media\Exif\ImageFileFormat.cs" />
<Compile Include="Media\Exif\JFIFEnums.cs" />
<Compile Include="Media\Exif\JFIFExtendedProperty.cs" />
<Compile Include="Media\Exif\JFIFThumbnail.cs" />
<Compile Include="Media\Exif\JPEGExceptions.cs" />
<Compile Include="Media\Exif\JPEGFile.cs" />
<Compile Include="Media\Exif\JPEGMarker.cs" />
<Compile Include="Media\Exif\JPEGSection.cs" />
<Compile Include="Media\Exif\MathEx.cs" />
<Compile Include="Media\Exif\SvgFile.cs" />
<Compile Include="Media\Exif\TIFFFile.cs" />
<Compile Include="Media\Exif\TIFFHeader.cs" />
<Compile Include="Media\Exif\TIFFStrip.cs" />
<Compile Include="Media\Exif\Utility.cs" />
<Compile Include="Media\ImageHelper.cs" />
<Compile Include="Media\TypeDetector\JpegDetector.cs" />
<Compile Include="Media\TypeDetector\RasterizedTypeDetector.cs" />
<Compile Include="Media\TypeDetector\SvgDetector.cs" />
<Compile Include="Media\TypeDetector\TIFFDetector.cs" />
<Compile Include="Media\UploadAutoFillProperties.cs" />
<Compile Include="Migrations\PostMigrations\PublishedSnapshotRebuilder.cs" />
<Compile Include="Models\AnchorsModel.cs" />
<Compile Include="Models\ContentEditing\DataTypeReferences.cs" />
@@ -316,16 +262,8 @@
<Compile Include="PropertyEditors\MultiUrlPickerValueEditor.cs" />
<Compile Include="PropertyEditors\ValueConverters\MultiUrlPickerValueConverter.cs" />
<Compile Include="Templates\ITemplateRenderer.cs" />
<Compile Include="Sections\SectionCollectionBuilder.cs" />
<Compile Include="Sections\FormsSection.cs" />
<Compile Include="Sections\MediaSection.cs" />
<Compile Include="Sections\MembersSection.cs" />
<Compile Include="Sections\PackagesSection.cs" />
<Compile Include="Sections\SettingsSection.cs" />
<Compile Include="Sections\TranslationSection.cs" />
<Compile Include="Trees\TreeCollectionBuilder.cs" />
<Compile Include="Trees\TreeUse.cs" />
<Compile Include="Sections\UsersSection.cs" />
<Compile Include="Trees\Tree.cs" />
<Compile Include="Trees\ITree.cs" />
<Compile Include="Models\ContentEditing\PublicAccess.cs" />
@@ -339,7 +277,6 @@
<Compile Include="Models\ContentEditing\UnpublishContent.cs" />
<Compile Include="Services\ITreeService.cs" />
<Compile Include="Services\ISectionService.cs" />
<Compile Include="Sections\SectionCollection.cs" />
<Compile Include="PropertyEditors\GridPropertyIndexValueFactory.cs" />
<Compile Include="PropertyEditors\PropertyEditorsComposer.cs" />
<Compile Include="PublishedCache\NuCache\NuCacheComposer.cs" />
@@ -650,9 +587,6 @@
<Compile Include="SignalR\PreviewHub.cs" />
<Compile Include="SignalR\PreviewHubComponent.cs" />
<Compile Include="Suspendable.cs" />
<Compile Include="Tour\BackOfficeTourFilter.cs" />
<Compile Include="Tour\TourFilterCollection.cs" />
<Compile Include="Tour\TourFilterCollectionBuilder.cs" />
<Compile Include="Trees\ContentBlueprintTreeController.cs" />
<Compile Include="Trees\RelationTypeTreeController.cs" />
<Compile Include="Trees\MacrosTreeController.cs" />
@@ -679,28 +613,7 @@
<Compile Include="Runtime\WebInitialComponent.cs" />
<Compile Include="Editors\PublishedStatusController.cs" />
<Compile Include="Editors\NuCacheStatusController.cs" />
<Compile Include="Actions\ActionAssignDomain.cs" />
<Compile Include="Actions\ActionBrowse.cs" />
<Compile Include="Actions\ActionChangeDocType.cs" />
<Compile Include="Actions\ActionCollection.cs" />
<Compile Include="Actions\ActionCollectionBuilder.cs" />
<Compile Include="Actions\ActionCopy.cs" />
<Compile Include="Actions\ActionCreateBlueprintFromContent.cs" />
<Compile Include="Actions\ActionDelete.cs" />
<Compile Include="Actions\ActionMove.cs" />
<Compile Include="Actions\ActionNew.cs" />
<Compile Include="Actions\ActionProtect.cs" />
<Compile Include="Actions\ActionPublish.cs" />
<Compile Include="Actions\ActionRestore.cs" />
<Compile Include="Actions\ActionRights.cs" />
<Compile Include="Actions\ActionRollback.cs" />
<Compile Include="Actions\ActionSort.cs" />
<Compile Include="Actions\ActionToPublish.cs" />
<Compile Include="Actions\ActionUnpublish.cs" />
<Compile Include="Actions\ActionUpdate.cs" />
<Compile Include="Actions\IAction.cs" />
<Compile Include="Models\ContentEditing\EntityBasic.cs" />
<Compile Include="Sections\ContentSection.cs" />
<Compile Include="Services\SectionService.cs" />
<Compile Include="Trees\TreeAttribute.cs" />
<Compile Include="Models\Trees\TreeNode.cs" />
@@ -761,7 +674,6 @@
<Compile Include="UmbracoDefaultOwinStartup.cs" />
<Compile Include="IUmbracoContextAccessor.cs" />
<Compile Include="HtmlStringUtilities.cs" />
<Compile Include="ITagQuery.cs" />
<Compile Include="IUmbracoComponentRenderer.cs" />
<Compile Include="Models\Mapping\RelationMapDefinition.cs" />
<Compile Include="Models\UnLinkLoginModel.cs" />
@@ -891,7 +803,6 @@
<Compile Include="Models\Mapping\MacroMapDefinition.cs" />
<Compile Include="Models\Mapping\MemberMapDefinition.cs" />
<Compile Include="Models\Mapping\TagMapDefinition.cs" />
<Compile Include="Models\TagModel.cs" />
<Compile Include="Models\UpgradeCheckResponse.cs" />
<Compile Include="Models\PasswordChangedModel.cs" />
<Compile Include="PropertyEditors\ColorPickerConfigurationEditor.cs" />
@@ -1176,7 +1087,6 @@
<Compile Include="Search\ExamineComponent.cs" />
<Compile Include="Compose\DatabaseServerRegistrarAndMessengerComponent.cs" />
<Compile Include="Templates\TemplateRenderer.cs" />
<Compile Include="Templates\TemplateUtilities.cs" />
<Compile Include="Trees\PartialViewMacrosTreeController.cs" />
<Compile Include="Trees\PartialViewsTreeController.cs" />
<Compile Include="Models\ContentEditing\NotificationStyle.cs" />