Fixes: U4-4741 Tags Property Editor Mishandles Tags with Commas
This commit is contained in:
@@ -442,7 +442,10 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var array = tagsToInsert
|
||||
.Select(tag =>
|
||||
string.Format("select '{0}' as Tag, '{1}' as [Group]",
|
||||
PetaPocoExtensions.EscapeAtSymbols(tag.Text.Replace("'", "''")),
|
||||
PetaPocoExtensions.EscapeAtSymbols(
|
||||
tag.Text
|
||||
.Replace("'", "''") //NOTE: I'm not sure about this apostrophe replacement but it's been like that for a long time
|
||||
.Replace(",", ",")), //NOTE: We need to replace commas with html encoded ones: http://issues.umbraco.org/issue/U4-4741
|
||||
tag.Group))
|
||||
.ToArray();
|
||||
return "(" + string.Join(" union ", array).Replace(" ", " ") + ") as TagSet";
|
||||
|
||||
@@ -19,6 +19,8 @@ angular.module("umbraco")
|
||||
function addTag(tagToAdd) {
|
||||
if (tagToAdd.length > 0) {
|
||||
if ($scope.currentTags.indexOf(tagToAdd) < 0) {
|
||||
//we need to html encode any tag containing commas: http://issues.umbraco.org/issue/U4-4741
|
||||
tagToAdd = tagToAdd.replace(",", ",");
|
||||
$scope.currentTags.push(tagToAdd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<div ng-controller="Umbraco.PropertyEditors.TagsController" class="umb-editor umb-tags">
|
||||
|
||||
|
||||
<div ng-if="isLoading">
|
||||
Loading...
|
||||
</div>
|
||||
|
||||
<div ng-if="!isLoading">
|
||||
<span ng-repeat="tag in currentTags" ng-click="removeTag(tag)" class="label label-primary tag">{{tag}} <i class="icon icon-delete"></i></span>
|
||||
<span ng-repeat="tag in currentTags" ng-click="removeTag(tag)" class="label label-primary tag">
|
||||
<span ng-bind-html="tag"></span>
|
||||
<i class="icon icon-delete"></i>
|
||||
</span>
|
||||
|
||||
<input type="text"
|
||||
class="typeahead tags-{{model.alias}}"
|
||||
|
||||
Reference in New Issue
Block a user