Skip to content

Commit

Permalink
[HOTFIX] Remove rendering helium description as HTML in Frontend (#4755)
Browse files Browse the repository at this point in the history
  • Loading branch information
jongyoul authored Apr 11, 2024
1 parent fa6e3ee commit 911f97d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.apache.commons.text.StringEscapeUtils.escapeHtml4;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

import java.util.Map;

Expand All @@ -31,7 +32,7 @@ void parseSpellPackageInfo() {
String examplePackage = "{\n" +
" \"type\" : \"SPELL\",\n" +
" \"name\" : \"echo-spell\",\n" +
" \"description\" : \"'%echo' - return just what receive (example)\",\n" +
" \"description\" : \"'%echo' - return just what receive (example)i<img src onerror=alert(3)>\",\n" +
" \"artifact\" : \"./zeppelin-examples/zeppelin-example-spell-echo\",\n" +
" \"license\" : \"Apache-2.0\",\n" +
" \"icon\" : \"<i class='fa fa-repeat'></i>\",\n" +
Expand All @@ -44,6 +45,7 @@ void parseSpellPackageInfo() {
HeliumPackage p = HeliumPackage.fromJson(examplePackage);
assertEquals("%echo", p.getSpellInfo().getMagic());
assertEquals(escapeHtml4("%echo <TEXT>"), p.getSpellInfo().getUsage());
assertNotEquals("'%echo' - return just what receive (example)i<img src onerror=alert(3)>", p.getDescription());
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/helium/helium.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export default function HeliumCtrl($scope, $rootScope, $sce,
};

$scope.getDescriptionText = function(pkgSearchResult) {
return $sce.trustAsHtml(pkgSearchResult.pkg.description);
return pkgSearchResult.pkg.description;
};

init();
Expand Down

0 comments on commit 911f97d

Please sign in to comment.