Merge pull request #280 from AndyButland/wip-u4-3980

Fix to SQL on inserting tags to handle tag with apostrophe (U4-3980)
This commit is contained in:
Shandem
2014-01-06 15:59:09 -08:00

View File

@@ -373,7 +373,7 @@ namespace Umbraco.Core.Persistence.Repositories
/// <returns></returns>
private static string GetTagSet(IEnumerable<ITag> tagsToInsert)
{
var array = tagsToInsert.Select(tag => string.Format("select '{0}' as Tag, '{1}' as [Group]", tag.Text, tag.Group)).ToArray();
var array = tagsToInsert.Select(tag => string.Format("select '{0}' as Tag, '{1}' as [Group]", tag.Text.Replace("'", "''"), tag.Group)).ToArray();
return "(" + string.Join(" union ", array).Replace(" ", " ") + ") as TagSet";
}