Fixes: U4-9217 - Sanitize tags before storing them in the database

This commit is contained in:
Sebastiaan Janssen
2016-11-23 14:24:08 +01:00
parent 1def61432e
commit 47c8e6854e

View File

@@ -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);