Fix $sanitize issue in the build logs view

This commit is contained in:
Joseph Schorr 2014-05-01 13:59:25 -04:00
parent bac3a4ba4f
commit bcc6caa9df

View file

@ -422,7 +422,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
builderService.getDescription = function(name, config) {
switch (name) {
case 'github':
var source = $sanitize(UtilService.textToSafeHtml(config['build_source']));
var source = UtilService.textToSafeHtml(config['build_source']);
var desc = '<i class="fa fa-github fa-lg" style="margin-left: 2px; margin-right: 2px"></i> Push to Github Repository ';
desc += '<a href="https://github.com/' + source + '" target="_blank">' + source + '</a>';
desc += '<br>Dockerfile folder: //' + UtilService.textToSafeHtml(config['subdir']);
@ -1594,7 +1594,7 @@ quayApp.directive('entityReference', function () {
'entity': '=entity',
'namespace': '=namespace'
},
controller: function($scope, $element, UserService, $sanitize) {
controller: function($scope, $element, UserService, UtilService) {
$scope.getIsAdmin = function(namespace) {
return UserService.isNamespaceAdmin(namespace);
};
@ -1612,10 +1612,10 @@ quayApp.directive('entityReference', function () {
var org = UserService.getOrganization(namespace);
if (!org) {
// This robot is owned by the user.
return '/user/?tab=robots&showRobot=' + $sanitize(name);
return '/user/?tab=robots&showRobot=' + UtilService.textToSafeHtml(name);
}
return '/organization/' + org['name'] + '/admin?tab=robots&showRobot=' + $sanitize(name);
return '/organization/' + org['name'] + '/admin?tab=robots&showRobot=' + UtilService.textToSafeHtml(name);
};
$scope.getPrefix = function(name) {
@ -4110,7 +4110,7 @@ quayApp.directive('dockerfileCommand', function () {
scope: {
'command': '=command'
},
controller: function($scope, $element, $sanitize, Config) {
controller: function($scope, $element, UtilService, Config) {
var registryHandlers = {
'quay.io': function(pieces) {
var rnamespace = pieces[pieces.length - 2];
@ -4147,11 +4147,11 @@ quayApp.directive('dockerfileCommand', function () {
$scope.getCommandTitleHtml = function(title) {
var space = title.indexOf(' ');
if (space <= 0) {
return $sanitize(title);
return UtilService.textToSafeHtml(title);
}
var kind = $scope.getCommandKind(title);
var sanitized = $sanitize(title.substring(space + 1));
var sanitized = UtilService.textToSafeHtml(title.substring(space + 1));
var handler = kindHandlers[kind || ''];
if (handler) {
@ -4176,7 +4176,7 @@ quayApp.directive('dockerfileView', function () {
scope: {
'contents': '=contents'
},
controller: function($scope, $element, $sanitize) {
controller: function($scope, $element, UtilService) {
$scope.$watch('contents', function(contents) {
$scope.lines = [];
@ -4191,7 +4191,7 @@ quayApp.directive('dockerfileView', function () {
}
var lineInfo = {
'text': $sanitize(line),
'text': UtilService.textToSafeHtml(line),
'kind': kind
};
$scope.lines.push(lineInfo);