Fixed a client side HTML decoding issue.

This commit is contained in:
Sipke Schoorstra
2015-02-23 16:01:54 +01:00
parent caa50ad440
commit bcfdd0120c
7 changed files with 4 additions and 8 deletions

View File

@@ -270,7 +270,7 @@ angular
$scope.$root.editElement(receivedElement).then(function (args) {
if (!args.cancel) {
receivedElement.data = decodeURIComponent(args.element.data);
receivedElement.setHtml(args.element.html);
receivedElement.setHtml(decodeURIComponent(args.element.html.replace(/\+/g, "%20")));
}
$timeout(function () {
if (!!args.cancel)
@@ -634,7 +634,6 @@ angular
// Overwrite the setHtml function so that we can use the $sce service to trust the html (and not have the html binding strip certain tags).
$scope.element.setHtml = function (html) {
html = decodeURIComponent(html.replace(/\+/g, "%20"));
$scope.element.html = html;
$scope.element.htmlUnsafe = $sce.trustAsHtml(html);
};

File diff suppressed because one or more lines are too long

View File

@@ -23,7 +23,6 @@
// Overwrite the setHtml function so that we can use the $sce service to trust the html (and not have the html binding strip certain tags).
$scope.element.setHtml = function (html) {
html = decodeURIComponent(html.replace(/\+/g, "%20"));
$scope.element.html = html;
$scope.element.htmlUnsafe = $sce.trustAsHtml(html);
};

View File

@@ -239,7 +239,7 @@
$scope.$root.editElement(receivedElement).then(function (args) {
if (!args.cancel) {
receivedElement.data = decodeURIComponent(args.element.data);
receivedElement.setHtml(args.element.html);
receivedElement.setHtml(decodeURIComponent(args.element.html.replace(/\+/g, "%20")));
}
$timeout(function () {
if (!!args.cancel)

View File

@@ -871,7 +871,6 @@ var LayoutEditor;
// This function will be overwritten by the Content directive.
this.setHtml = function (html) {
html = decodeURIComponent(html.replace(/\+/g, "%20"));
this.html = html;
this.htmlUnsafe = html;
}

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,6 @@
// This function will be overwritten by the Content directive.
this.setHtml = function (html) {
html = decodeURIComponent(html.replace(/\+/g, "%20"));
this.html = html;
this.htmlUnsafe = html;
}