Skip to content

Commit 9040494

Browse files
committed
avoid bad url forging when contact logo from existing org
have to use ng-attr-xlink:href or ng-attr-href so to allow expression evalution in angular template for xlink:href. if 'link' test for '../api/logos', have to href '../api/logos', not '../../images/harvesting'.
1 parent adc1fce commit 9040494

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,10 +1561,10 @@
15611561
' viewBox="0 0 500 500">' +
15621562
" <defs>" +
15631563
' <pattern id="image{{imageId}}" x="0" y="0" patternUnits="userSpaceOnUse" height="100%" width="100%">' +
1564-
' <image ng-if="hasIcon" x="0" y="0" height="100%" width="100%" xlink:href="{{\'../../images/harvesting/\' + orgKey + \'.png\'}}"></image>' +
1564+
' <image ng-if="hasIcon" x="0" y="0" height="100%" width="100%" ng-attr-href="{{\'../api/logos/\' + orgKey + \'.png\'}}" ng-attr-xlink:href="{{\'../api/logos/\' + orgKey + \'.png\'}}"></image>' +
15651565
" </pattern>" +
15661566
" </defs>" +
1567-
' <circle fill="url(\'#image{{imageId}}\')" style="stroke-miterlimit:10;" cx="250" cy="250" r="240"/>' +
1567+
' <circle fill="url(#image{{imageId}})" style="stroke-miterlimit:10;" cx="250" cy="250" r="240"/>' +
15681568
' <text x="50%" y="50%"' +
15691569
' text-anchor="middle" alignment-baseline="central" dominant-baseline="central"' +
15701570
" font-size=\"300\">{{hasIcon ? '' : org.substr(0, 1).toUpperCase()}}</text>" +

0 commit comments

Comments
 (0)