From 1def61432eb2e15539c6a9a092977e86fb701d67 Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 23 Nov 2016 10:58:52 +0100 Subject: [PATCH 1/2] U4-9216 - fix saving containers --- src/Umbraco.Core/Services/ContentTypeService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentTypeService.cs b/src/Umbraco.Core/Services/ContentTypeService.cs index d80a93a4ab..31e86cd128 100644 --- a/src/Umbraco.Core/Services/ContentTypeService.cs +++ b/src/Umbraco.Core/Services/ContentTypeService.cs @@ -141,7 +141,7 @@ namespace Umbraco.Core.Services { var evtMsgs = EventMessagesFactory.Get(); - if (container.ContainedObjectType != containerObjectType) + if (container.ContainerObjectType != containerObjectType) { var ex = new InvalidOperationException("Not a " + objectTypeName + " container."); return OperationStatus.Exception(evtMsgs, ex); @@ -799,7 +799,7 @@ namespace Umbraco.Core.Services // of a different type, move them to the recycle bin, then permanently delete the content items. // The main problem with this is that for every content item being deleted, events are raised... // which we need for many things like keeping caches in sync, but we can surely do this MUCH better. - + var deletedContentTypes = new List() {contentType}; deletedContentTypes.AddRange(contentType.Descendants().OfType()); @@ -807,7 +807,7 @@ namespace Umbraco.Core.Services { _contentService.DeleteContentOfType(deletedContentType.Id); } - + repository.Delete(contentType); uow.Commit(); From 47c8e6854ee2aafc99fa7fc0b7d901fc59020adb Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 23 Nov 2016 14:24:08 +0100 Subject: [PATCH 2/2] Fixes: U4-9217 - Sanitize tags before storing them in the database --- .../src/views/propertyeditors/tags/tags.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js index a1e48bbc99..d18ff73bd5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js @@ -1,6 +1,6 @@ angular.module("umbraco") .controller("Umbraco.PropertyEditors.TagsController", - function ($rootScope, $scope, $log, assetsService, umbRequestHelper, angularHelper, $timeout, $element) { + function ($rootScope, $scope, $log, assetsService, umbRequestHelper, angularHelper, $timeout, $element, $sanitize) { var $typeahead; @@ -41,6 +41,7 @@ angular.module("umbraco") //Helper method to add a tag on enter or on typeahead select function addTag(tagToAdd) { + tagToAdd = $sanitize(tagToAdd); if (tagToAdd != null && tagToAdd.length > 0) { if ($scope.model.value.indexOf(tagToAdd) < 0) { $scope.model.value.push(tagToAdd);