diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6caeadd0e5..9dc6f9457f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -16,7 +16,7 @@ This document gives you a quick overview on how to get started, we will link to ## Guidelines for contributions we welcome -Not all changes are wanted, so on occassion we might close a PR without merging it. We will give you feedback why we can't accept your changes and we'll be nice about it, thanking you for spending your valueable time. +Not all changes are wanted, so on occassion we might close a PR without merging it. We will give you feedback why we can't accept your changes and we'll be nice about it, thanking you for spending your valuable time. We have [documented what we consider small and large changes](CONTRIBUTION_GUIDELINES.md). Make sure to talk to us before making large changes. diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index 9517d7f1d5..98eaf9f4e9 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -187,7 +187,6 @@ namespace Umbraco.Core outputArray[i] = char.IsLetterOrDigit(inputArray[i]) ? inputArray[i] : replacement; return new string(outputArray); } - private static readonly char[] CleanForXssChars = "*?(){}[];:%<>/\\|&'\"".ToCharArray(); /// diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs index 349648dd98..f0db3991b8 100644 --- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs @@ -69,6 +69,17 @@ namespace Umbraco.Tests.Strings Assert.AreEqual(stripped, result); } + [TestCase("'+alert(1234)+'", "+alert1234+")] + [TestCase("'+alert(56+78)+'", "+alert56+78+")] + [TestCase("{{file}}", "file")] + [TestCase("'+alert('hello')+'", "+alerthello+")] + [TestCase("Test", "Test")] + public void Clean_From_XSS(string input, string result) + { + var cleaned = input.CleanForXss(); + Assert.AreEqual(cleaned, result); + } + [TestCase("This is a string to encrypt")] [TestCase("This is a string to encrypt\nThis is a second line")] [TestCase(" White space is preserved ")] diff --git a/src/Umbraco.Web.UI.Client/src/less/helveticons.less b/src/Umbraco.Web.UI.Client/src/less/helveticons.less index 60ccd3c357..1083a490e0 100644 --- a/src/Umbraco.Web.UI.Client/src/less/helveticons.less +++ b/src/Umbraco.Web.UI.Client/src/less/helveticons.less @@ -17,12 +17,14 @@ -webkit-font-smoothing: antialiased; *margin-right: .3em; } + [class^="icon-"]:before, [class*=" icon-"]:before { text-decoration: inherit; display: inline-block; speak: none; } + /* [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'icomoon'; @@ -38,7 +40,6 @@ i.large{ font-size: 32px; } - i.medium{ font-size: 24px; } @@ -187,8 +188,6 @@ i.small{ .icon-umb-translation:before, .traytranslation:before { content: "\e1fd"; } - - .icon-tv:before { content: "\e02e"; } @@ -213,7 +212,8 @@ i.small{ .icon-train:before { content: "\e035"; } -.icon-trafic:before { +.icon-trafic:before, +.icon-traffic:before { content: "\e036"; } .icon-traffic-alt:before { @@ -255,6 +255,7 @@ i.small{ .icon-target:before { content: "\e043"; } +.icon-temperature-alt:before, .icon-temperatrure-alt:before { content: "\e044"; } @@ -267,6 +268,7 @@ i.small{ .icon-theater:before { content: "\e047"; } +.icon-thief:before, .icon-theif:before { content: "\e048"; } @@ -375,6 +377,7 @@ i.small{ .icon-shuffle:before { content: "\e06b"; } +.icon-science:before, .icon-sience:before { content: "\e06c"; } @@ -747,6 +750,7 @@ i.small{ .icon-pictures-alt-2:before { content: "\e0e7"; } +.icon-panel-close:before, .icon-pannel-close:before { content: "\e0e8"; } @@ -1627,6 +1631,7 @@ i.small{ .icon-alarm-clock:before { content: "\e20c"; } +.icon-addressbook:before, .icon-adressbook:before { content: "\e20d"; } diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js index 6b1021b663..9fbf342435 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js @@ -42,14 +42,21 @@ function contentCreateController($scope, } function createOrSelectBlueprintIfAny(docType) { - var blueprintIds = _.keys(docType.blueprints || {}); + // map the blueprints into a collection that's sortable in the view + var blueprints = _.map(_.pairs(docType.blueprints || {}), function (pair) { + return { + id: pair[0], + name: pair[1] + }; + }); $scope.docType = docType; - if (blueprintIds.length) { + if (blueprints.length) { if (blueprintConfig.skipSelect) { - createFromBlueprint(blueprintIds[0]); + createFromBlueprint(blueprints[0].id); } else { $scope.selectContentType = false; $scope.selectBlueprint = true; + $scope.selectableBlueprints = blueprints; } } else { createBlank(docType); diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.notify.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.notify.controller.js index 4c446b11e0..9f59fba0ea 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.notify.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.notify.controller.js @@ -3,7 +3,8 @@ $scope, contentResource, navigationService, - angularHelper) { + angularHelper, + localizationService) { var vm = this; var currentForm; vm.notifyOptions = []; @@ -11,7 +12,8 @@ vm.cancel = cancel; vm.message = { name: $scope.currentNode.name - };; + }; + vm.labels = {}; function onInit() { vm.loading = true; contentResource.getNotifySettingsById($scope.currentNode.id).then(function (options) { @@ -19,6 +21,9 @@ vm.loading = false; vm.notifyOptions = options; }); + localizationService.localize("notifications_editNotifications", [$scope.currentNode.name]).then(function(value) { + vm.labels.headline = value; + }); } function cancel() { navigationService.hideMenu(); diff --git a/src/Umbraco.Web.UI.Client/src/views/content/copy.html b/src/Umbraco.Web.UI.Client/src/views/content/copy.html index 8f6d5d3e6d..0ebe577ed8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/copy.html @@ -12,13 +12,16 @@
{{source.name}} was copied to + was copied to {{target.name}}

- Choose where to copy {{source.name}} to in the tree structure below + Choose where to copy + {{source.name}} + to in the tree structure below

diff --git a/src/Umbraco.Web.UI.Client/src/views/content/create.html b/src/Umbraco.Web.UI.Client/src/views/content/create.html index e76d17caa8..94299f6a54 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/create.html @@ -25,13 +25,13 @@ -
- {{currentNode.name}} + {{currentNode.name}}
- Set your notification for {{ currentNode.name }} +
- {{source.name}} was moved underneath {{target.name}} + {{source.name}} + was moved to + {{target.name}}
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index 1d8cdfa03f..96e7ccdbfd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -701,16 +701,23 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs } getContentTypesCallback(id).then(function (listViewAllowedTypes) { - $scope.listViewAllowedTypes = listViewAllowedTypes; + $scope.listViewAllowedTypes = listViewAllowedTypes; var blueprints = false; _.each(listViewAllowedTypes, function (allowedType) { if (_.isEmpty(allowedType.blueprints)) { - // this helps the view understand that there are no blueprints available - allowedType.blueprints = null; + // this helps the view understand that there are no blueprints available + allowedType.blueprints = null; } else { - blueprints = true; + blueprints = true; + // turn the content type blueprints object into an array of sortable objects for the view + allowedType.blueprints = _.map(_.pairs(allowedType.blueprints || {}), function (pair) { + return { + id: pair[0], + name: pair[1] + }; + }); } }); @@ -776,17 +783,19 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs } } - function createBlank(entityType, docTypeAlias) { $location .path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId) - .search("doctype=" + docTypeAlias + "&create=true"); + .search("doctype", docTypeAlias) + .search("create", "true"); } function createFromBlueprint(entityType, docTypeAlias, blueprintId) { $location .path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId) - .search("doctype=" + docTypeAlias + "&create=true&blueprintId=" + blueprintId); + .search("doctype", docTypeAlias) + .search("create", "true") + .search("blueprintId", blueprintId); } $scope.createBlank = createBlank; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html index 44636d7033..77576cac6a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html @@ -27,10 +27,10 @@ - - + + - {{::value}} + {{::blueprint.name}} @@ -48,9 +48,9 @@ {{::contentType.name}} (blank) - +    - {{::value}} + {{::blueprint.name}} @@ -58,11 +58,11 @@