@openui5/sap.m 1.108.40 → 1.108.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRDPARTY.txt +1 -1
- package/package.json +4 -4
- package/src/sap/m/.library +2 -2
- package/src/sap/m/AccButton.js +1 -1
- package/src/sap/m/ActionListItem.js +1 -1
- package/src/sap/m/ActionSelect.js +1 -1
- package/src/sap/m/ActionSheet.js +1 -1
- package/src/sap/m/ActionTile.js +1 -1
- package/src/sap/m/ActionTileContent.js +1 -1
- package/src/sap/m/AdditionalTextButton.js +1 -1
- package/src/sap/m/App.js +1 -1
- package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
- package/src/sap/m/Avatar.js +1 -1
- package/src/sap/m/Bar.js +1 -1
- package/src/sap/m/Breadcrumbs.js +1 -1
- package/src/sap/m/BusyDialog.js +1 -1
- package/src/sap/m/BusyIndicator.js +1 -1
- package/src/sap/m/Button.js +1 -1
- package/src/sap/m/Carousel.js +1 -1
- package/src/sap/m/CarouselLayout.js +1 -1
- package/src/sap/m/CheckBox.js +1 -1
- package/src/sap/m/ColorPalette.js +1 -1
- package/src/sap/m/ColorPalettePopover.js +1 -1
- package/src/sap/m/Column.js +1 -1
- package/src/sap/m/ColumnHeaderPopover.js +2 -2
- package/src/sap/m/ColumnListItem.js +1 -1
- package/src/sap/m/ColumnPopoverActionItem.js +1 -1
- package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
- package/src/sap/m/ColumnPopoverItem.js +1 -1
- package/src/sap/m/ColumnPopoverSelectListItem.js +1 -1
- package/src/sap/m/ColumnPopoverSortItem.js +1 -1
- package/src/sap/m/ComboBox.js +1 -1
- package/src/sap/m/ComboBoxBase.js +1 -1
- package/src/sap/m/ComboBoxTextField.js +1 -1
- package/src/sap/m/CustomDynamicDateOption.js +1 -1
- package/src/sap/m/CustomListItem.js +1 -1
- package/src/sap/m/CustomTile.js +1 -1
- package/src/sap/m/CustomTreeItem.js +1 -1
- package/src/sap/m/DatePicker.js +1 -21
- package/src/sap/m/DateRangeSelection.js +2 -2
- package/src/sap/m/DateTimeField.js +1 -1
- package/src/sap/m/DateTimeInput.js +1 -1
- package/src/sap/m/DateTimePicker.js +1 -1
- package/src/sap/m/Dialog.js +1 -1
- package/src/sap/m/DisplayListItem.js +1 -1
- package/src/sap/m/DraftIndicator.js +1 -1
- package/src/sap/m/DynamicDate.js +1 -1
- package/src/sap/m/DynamicDateOption.js +1 -1
- package/src/sap/m/DynamicDateRange.js +1 -1
- package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
- package/src/sap/m/ExpandableText.js +1 -1
- package/src/sap/m/FacetFilter.js +1 -1
- package/src/sap/m/FacetFilterItem.js +1 -1
- package/src/sap/m/FacetFilterList.js +1 -1
- package/src/sap/m/FeedContent.js +1 -1
- package/src/sap/m/FeedInput.js +1 -1
- package/src/sap/m/FeedListItem.js +8 -2
- package/src/sap/m/FeedListItemAction.js +1 -1
- package/src/sap/m/Fiori20Adapter.js +2 -2
- package/src/sap/m/FlexBox.js +1 -1
- package/src/sap/m/FlexItemData.js +1 -1
- package/src/sap/m/FormattedText.js +1 -1
- package/src/sap/m/GenericTag.js +1 -1
- package/src/sap/m/GenericTile.js +1 -1
- package/src/sap/m/GroupHeaderListItem.js +1 -1
- package/src/sap/m/GrowingEnablement.js +27 -7
- package/src/sap/m/GrowingList.js +1 -1
- package/src/sap/m/HBox.js +1 -1
- package/src/sap/m/HeaderContainer.js +1 -1
- package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
- package/src/sap/m/IconTabBar.js +1 -1
- package/src/sap/m/IconTabBarSelectList.js +1 -1
- package/src/sap/m/IconTabFilter.js +1 -1
- package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
- package/src/sap/m/IconTabHeader.js +1 -1
- package/src/sap/m/IconTabSeparator.js +1 -1
- package/src/sap/m/IllustratedMessage.js +1 -1
- package/src/sap/m/Illustration.js +1 -1
- package/src/sap/m/Image.js +1 -1
- package/src/sap/m/ImageContent.js +1 -1
- package/src/sap/m/Input.js +1 -1
- package/src/sap/m/InputBase.js +1 -1
- package/src/sap/m/InputListItem.js +1 -1
- package/src/sap/m/Label.js +1 -1
- package/src/sap/m/LightBox.js +1 -1
- package/src/sap/m/LightBoxItem.js +1 -1
- package/src/sap/m/Link.js +1 -1
- package/src/sap/m/List.js +1 -1
- package/src/sap/m/ListBase.js +5 -3
- package/src/sap/m/ListItemBase.js +1 -1
- package/src/sap/m/MaskEnabler.js +1 -1
- package/src/sap/m/MaskInput.js +1 -1
- package/src/sap/m/MaskInputRule.js +1 -1
- package/src/sap/m/Menu.js +1 -1
- package/src/sap/m/MenuButton.js +1 -1
- package/src/sap/m/MenuItem.js +1 -1
- package/src/sap/m/MenuListItem.js +1 -1
- package/src/sap/m/MessageItem.js +1 -1
- package/src/sap/m/MessageListItem.js +1 -1
- package/src/sap/m/MessagePage.js +1 -1
- package/src/sap/m/MessagePopover.js +1 -1
- package/src/sap/m/MessagePopoverItem.js +1 -1
- package/src/sap/m/MessageStrip.js +1 -1
- package/src/sap/m/MessageToast.js +1 -1
- package/src/sap/m/MessageView.js +1 -1
- package/src/sap/m/MultiComboBox.js +1 -1
- package/src/sap/m/MultiEditField.js +1 -1
- package/src/sap/m/MultiInput.js +1 -1
- package/src/sap/m/NavContainer.js +1 -1
- package/src/sap/m/NewsContent.js +1 -1
- package/src/sap/m/NotificationList.js +1 -1
- package/src/sap/m/NotificationListBase.js +1 -1
- package/src/sap/m/NotificationListGroup.js +1 -1
- package/src/sap/m/NotificationListItem.js +1 -1
- package/src/sap/m/NumericContent.js +1 -1
- package/src/sap/m/NumericInput.js +1 -1
- package/src/sap/m/ObjectAttribute.js +1 -1
- package/src/sap/m/ObjectHeader.js +1 -1
- package/src/sap/m/ObjectIdentifier.js +1 -1
- package/src/sap/m/ObjectListItem.js +1 -1
- package/src/sap/m/ObjectMarker.js +1 -1
- package/src/sap/m/ObjectNumber.js +1 -1
- package/src/sap/m/ObjectStatus.js +1 -1
- package/src/sap/m/OverflowToolbar.js +1 -1
- package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
- package/src/sap/m/OverflowToolbarButton.js +1 -1
- package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
- package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
- package/src/sap/m/P13nAnyFilterItem.js +1 -1
- package/src/sap/m/P13nColumnsItem.js +1 -1
- package/src/sap/m/P13nColumnsPanel.js +1 -1
- package/src/sap/m/P13nConditionPanel.js +1 -1
- package/src/sap/m/P13nDialog.js +1 -1
- package/src/sap/m/P13nDimMeasureItem.js +1 -1
- package/src/sap/m/P13nDimMeasurePanel.js +1 -1
- package/src/sap/m/P13nFilterItem.js +1 -1
- package/src/sap/m/P13nFilterPanel.js +1 -1
- package/src/sap/m/P13nGroupItem.js +1 -1
- package/src/sap/m/P13nGroupPanel.js +1 -1
- package/src/sap/m/P13nItem.js +1 -1
- package/src/sap/m/P13nPanel.js +1 -1
- package/src/sap/m/P13nSelectionItem.js +1 -1
- package/src/sap/m/P13nSelectionPanel.js +1 -1
- package/src/sap/m/P13nSortItem.js +1 -1
- package/src/sap/m/P13nSortPanel.js +1 -1
- package/src/sap/m/PDFViewer.js +6 -6
- package/src/sap/m/Page.js +1 -1
- package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/m/PagingButton.js +1 -1
- package/src/sap/m/Panel.js +1 -1
- package/src/sap/m/PlanningCalendar.js +1 -1
- package/src/sap/m/PlanningCalendarHeader.js +1 -1
- package/src/sap/m/PlanningCalendarLegend.js +1 -1
- package/src/sap/m/PlanningCalendarRow.js +1 -1
- package/src/sap/m/PlanningCalendarView.js +1 -1
- package/src/sap/m/Popover.js +1 -1
- package/src/sap/m/ProgressIndicator.js +1 -1
- package/src/sap/m/PullToRefresh.js +1 -1
- package/src/sap/m/QuickView.js +1 -1
- package/src/sap/m/QuickViewBase.js +1 -1
- package/src/sap/m/QuickViewCard.js +1 -1
- package/src/sap/m/QuickViewGroup.js +1 -1
- package/src/sap/m/QuickViewGroupElement.js +1 -1
- package/src/sap/m/QuickViewPage.js +1 -1
- package/src/sap/m/RadioButton.js +1 -1
- package/src/sap/m/RadioButtonGroup.js +1 -1
- package/src/sap/m/RangeSlider.js +1 -1
- package/src/sap/m/RatingIndicator.js +1 -1
- package/src/sap/m/ResponsivePopover.js +1 -1
- package/src/sap/m/ResponsiveScale.js +1 -1
- package/src/sap/m/ScrollBar.js +1 -1
- package/src/sap/m/ScrollContainer.js +1 -1
- package/src/sap/m/SearchField.js +1 -1
- package/src/sap/m/SegmentedButton.js +1 -1
- package/src/sap/m/SegmentedButtonItem.js +1 -1
- package/src/sap/m/Select.js +1 -1
- package/src/sap/m/SelectDialog.js +1 -1
- package/src/sap/m/SelectDialogBase.js +1 -1
- package/src/sap/m/SelectList.js +1 -1
- package/src/sap/m/SelectionDetails.js +1 -1
- package/src/sap/m/SelectionDetailsFacade.js +2 -2
- package/src/sap/m/SelectionDetailsItem.js +1 -1
- package/src/sap/m/SelectionDetailsItemLine.js +1 -1
- package/src/sap/m/Shell.js +1 -1
- package/src/sap/m/SimpleFixFlex.js +1 -1
- package/src/sap/m/SinglePlanningCalendar.js +1 -1
- package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarGrid.js +1 -1
- package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
- package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
- package/src/sap/m/SlideTile.js +1 -1
- package/src/sap/m/Slider.js +1 -1
- package/src/sap/m/SliderTooltip.js +1 -1
- package/src/sap/m/SliderTooltipBase.js +1 -1
- package/src/sap/m/SliderTooltipContainer.js +1 -1
- package/src/sap/m/SplitApp.js +1 -1
- package/src/sap/m/SplitButton.js +1 -1
- package/src/sap/m/SplitContainer.js +1 -1
- package/src/sap/m/StandardDynamicDateOption.js +1 -1
- package/src/sap/m/StandardListItem.js +1 -1
- package/src/sap/m/StandardTile.js +1 -1
- package/src/sap/m/StandardTreeItem.js +1 -1
- package/src/sap/m/StepInput.js +1 -1
- package/src/sap/m/SuggestionItem.js +1 -1
- package/src/sap/m/SuggestionsPopover.js +5 -5
- package/src/sap/m/Switch.js +1 -1
- package/src/sap/m/TabContainer.js +1 -1
- package/src/sap/m/TabContainerItem.js +1 -1
- package/src/sap/m/TabStrip.js +1 -1
- package/src/sap/m/TabStripItem.js +1 -1
- package/src/sap/m/Table.js +1 -1
- package/src/sap/m/TablePersoController.js +1 -1
- package/src/sap/m/TablePersoDialog.js +1 -1
- package/src/sap/m/TablePersoProvider.js +1 -1
- package/src/sap/m/TableSelectDialog.js +1 -1
- package/src/sap/m/Text.js +1 -1
- package/src/sap/m/TextArea.js +1 -1
- package/src/sap/m/Tile.js +1 -1
- package/src/sap/m/TileContainer.js +1 -1
- package/src/sap/m/TileContent.js +1 -1
- package/src/sap/m/TimePicker.js +1 -1
- package/src/sap/m/TimePickerClock.js +1 -1
- package/src/sap/m/TimePickerClocks.js +1 -1
- package/src/sap/m/TimePickerInputs.js +1 -1
- package/src/sap/m/TimePickerInternals.js +1 -1
- package/src/sap/m/TimePickerSlider.js +1 -1
- package/src/sap/m/TimePickerSliders.js +1 -1
- package/src/sap/m/Title.js +1 -1
- package/src/sap/m/TitlePropagationSupport.js +1 -1
- package/src/sap/m/ToggleButton.js +1 -1
- package/src/sap/m/Token.js +1 -1
- package/src/sap/m/Tokenizer.js +1 -1
- package/src/sap/m/Toolbar.js +1 -1
- package/src/sap/m/ToolbarLayoutData.js +1 -1
- package/src/sap/m/ToolbarSeparator.js +1 -1
- package/src/sap/m/ToolbarSpacer.js +1 -1
- package/src/sap/m/Tree.js +1 -1
- package/src/sap/m/TreeItemBase.js +1 -1
- package/src/sap/m/UploadCollection.js +1 -1
- package/src/sap/m/UploadCollectionItem.js +1 -1
- package/src/sap/m/UploadCollectionParameter.js +1 -1
- package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
- package/src/sap/m/VBox.js +1 -1
- package/src/sap/m/ValueStateHeader.js +9 -4
- package/src/sap/m/ViewSettingsCustomItem.js +1 -1
- package/src/sap/m/ViewSettingsCustomTab.js +1 -1
- package/src/sap/m/ViewSettingsDialog.js +1 -1
- package/src/sap/m/ViewSettingsFilterItem.js +1 -1
- package/src/sap/m/ViewSettingsItem.js +1 -1
- package/src/sap/m/VisibleItem.js +1 -1
- package/src/sap/m/WheelSlider.js +1 -1
- package/src/sap/m/WheelSliderContainer.js +1 -1
- package/src/sap/m/Wizard.js +1 -1
- package/src/sap/m/WizardProgressNavigator.js +1 -1
- package/src/sap/m/WizardStep.js +1 -1
- package/src/sap/m/_thirdparty/purify.js +151 -362
- package/src/sap/m/changeHandler/AddTableColumn.js +1 -1
- package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
- package/src/sap/m/changeHandler/CombineButtons.js +1 -1
- package/src/sap/m/changeHandler/MoveTableColumns.js +1 -1
- package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
- package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
- package/src/sap/m/designtime/messagebundle_da.properties +2 -2
- package/src/sap/m/designtime/messagebundle_de.properties +4 -4
- package/src/sap/m/designtime/messagebundle_fr.properties +2 -2
- package/src/sap/m/designtime/messagebundle_ko.properties +2 -2
- package/src/sap/m/designtime/messagebundle_uk.properties +1 -1
- package/src/sap/m/library.js +2 -2
- package/src/sap/m/messagebundle_ar.properties +1 -1
- package/src/sap/m/messagebundle_bg.properties +25 -25
- package/src/sap/m/messagebundle_ca.properties +3 -3
- package/src/sap/m/messagebundle_cs.properties +4 -4
- package/src/sap/m/messagebundle_cy.properties +11 -11
- package/src/sap/m/messagebundle_da.properties +18 -18
- package/src/sap/m/messagebundle_de.properties +10 -10
- package/src/sap/m/messagebundle_el.properties +19 -19
- package/src/sap/m/messagebundle_en.properties +2 -2
- package/src/sap/m/messagebundle_en_GB.properties +1 -1
- package/src/sap/m/messagebundle_en_US_saprigi.properties +2 -2
- package/src/sap/m/messagebundle_es.properties +74 -74
- package/src/sap/m/messagebundle_es_MX.properties +15 -15
- package/src/sap/m/messagebundle_et.properties +1 -1
- package/src/sap/m/messagebundle_fi.properties +2 -2
- package/src/sap/m/messagebundle_fr.properties +22 -22
- package/src/sap/m/messagebundle_fr_CA.properties +26 -26
- package/src/sap/m/messagebundle_hi.properties +3 -3
- package/src/sap/m/messagebundle_hr.properties +49 -49
- package/src/sap/m/messagebundle_hu.properties +5 -5
- package/src/sap/m/messagebundle_id.properties +24 -24
- package/src/sap/m/messagebundle_it.properties +6 -6
- package/src/sap/m/messagebundle_iw.properties +1 -1
- package/src/sap/m/messagebundle_ja.properties +1 -1
- package/src/sap/m/messagebundle_kk.properties +15 -15
- package/src/sap/m/messagebundle_ko.properties +7 -7
- package/src/sap/m/messagebundle_lv.properties +41 -41
- package/src/sap/m/messagebundle_ms.properties +21 -21
- package/src/sap/m/messagebundle_nl.properties +4 -4
- package/src/sap/m/messagebundle_no.properties +3 -3
- package/src/sap/m/messagebundle_pl.properties +7 -7
- package/src/sap/m/messagebundle_pt.properties +1 -1
- package/src/sap/m/messagebundle_ro.properties +3 -3
- package/src/sap/m/messagebundle_ru.properties +4 -4
- package/src/sap/m/messagebundle_sh.properties +4 -4
- package/src/sap/m/messagebundle_sk.properties +5 -5
- package/src/sap/m/messagebundle_sl.properties +24 -24
- package/src/sap/m/messagebundle_sr.properties +4 -4
- package/src/sap/m/messagebundle_sv.properties +5 -5
- package/src/sap/m/messagebundle_th.properties +13 -13
- package/src/sap/m/messagebundle_tr.properties +2 -2
- package/src/sap/m/messagebundle_uk.properties +16 -16
- package/src/sap/m/messagebundle_vi.properties +10 -10
- package/src/sap/m/messagebundle_zh_TW.properties +5 -5
- package/src/sap/m/p13n/AbstractContainer.js +2 -2
- package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
- package/src/sap/m/p13n/BasePanel.js +1 -1
- package/src/sap/m/p13n/Container.js +1 -1
- package/src/sap/m/p13n/Engine.js +1 -1
- package/src/sap/m/p13n/GroupController.js +1 -1
- package/src/sap/m/p13n/GroupPanel.js +1 -1
- package/src/sap/m/p13n/Popup.js +1 -1
- package/src/sap/m/p13n/QueryPanel.js +1 -1
- package/src/sap/m/p13n/SelectionController.js +1 -1
- package/src/sap/m/p13n/SelectionPanel.js +1 -1
- package/src/sap/m/p13n/SortController.js +1 -1
- package/src/sap/m/p13n/SortPanel.js +1 -1
- package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +1 -1
- package/src/sap/m/p13n/modules/StateHandlerRegistry.js +1 -1
- package/src/sap/m/p13n/modules/UIManager.js +1 -1
- package/src/sap/m/plugins/CellSelector.js +1 -1
- package/src/sap/m/plugins/ColumnResizer.js +1 -1
- package/src/sap/m/plugins/DataStateIndicator.js +1 -1
- package/src/sap/m/plugins/PasteProvider.js +1 -1
- package/src/sap/m/plugins/PluginBase.js +1 -1
- package/src/sap/m/semantic/AddAction.js +1 -1
- package/src/sap/m/semantic/CancelAction.js +1 -1
- package/src/sap/m/semantic/DeleteAction.js +1 -1
- package/src/sap/m/semantic/DetailPage.js +1 -1
- package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
- package/src/sap/m/semantic/EditAction.js +1 -1
- package/src/sap/m/semantic/FavoriteAction.js +1 -1
- package/src/sap/m/semantic/FilterAction.js +1 -1
- package/src/sap/m/semantic/FilterSelect.js +1 -1
- package/src/sap/m/semantic/FlagAction.js +1 -1
- package/src/sap/m/semantic/ForwardAction.js +1 -1
- package/src/sap/m/semantic/FullscreenPage.js +1 -1
- package/src/sap/m/semantic/GroupAction.js +1 -1
- package/src/sap/m/semantic/GroupSelect.js +1 -1
- package/src/sap/m/semantic/MainAction.js +1 -1
- package/src/sap/m/semantic/MasterPage.js +1 -1
- package/src/sap/m/semantic/MessagesIndicator.js +1 -1
- package/src/sap/m/semantic/MultiSelectAction.js +1 -1
- package/src/sap/m/semantic/NegativeAction.js +1 -1
- package/src/sap/m/semantic/OpenInAction.js +1 -1
- package/src/sap/m/semantic/PositiveAction.js +1 -1
- package/src/sap/m/semantic/PrintAction.js +1 -1
- package/src/sap/m/semantic/SaveAction.js +1 -1
- package/src/sap/m/semantic/Segment.js +1 -1
- package/src/sap/m/semantic/SegmentedContainer.js +1 -1
- package/src/sap/m/semantic/SemanticButton.js +1 -1
- package/src/sap/m/semantic/SemanticConfiguration.js +1 -1
- package/src/sap/m/semantic/SemanticControl.js +1 -1
- package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
- package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
- package/src/sap/m/semantic/SemanticPage.js +1 -1
- package/src/sap/m/semantic/SemanticSelect.js +1 -1
- package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
- package/src/sap/m/semantic/SendEmailAction.js +1 -1
- package/src/sap/m/semantic/SendMessageAction.js +1 -1
- package/src/sap/m/semantic/ShareInJamAction.js +1 -1
- package/src/sap/m/semantic/ShareMenu.js +1 -1
- package/src/sap/m/semantic/ShareMenuPage.js +1 -1
- package/src/sap/m/semantic/SortAction.js +1 -1
- package/src/sap/m/semantic/SortSelect.js +1 -1
- package/src/sap/m/table/Util.js +1 -1
- package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
- package/src/sap/m/table/columnmenu/Entry.js +1 -1
- package/src/sap/m/table/columnmenu/Item.js +1 -1
- package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
- package/src/sap/m/table/columnmenu/Menu.js +1 -1
- package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
- package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
- package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickGroup.js +1 -1
- package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickSort.js +1 -1
- package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickTotal.js +1 -1
- package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -1
- package/src/sap/m/themes/base/ValueStateHeader.less +4 -0
- package/src/sap/m/upload/UploadSet.js +1 -1
- package/src/sap/m/upload/UploadSetItem.js +1 -1
- package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.
|
|
1
|
+
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
|
|
2
|
+
// #### BEGIN: MODIFIED BY SAP
|
|
2
3
|
|
|
3
4
|
sap.ui.define([], function () { 'use strict';
|
|
4
5
|
|
|
6
|
+
// #### END: MODIFIED BY SAP
|
|
7
|
+
|
|
5
8
|
const {
|
|
6
9
|
entries,
|
|
7
10
|
setPrototypeOf,
|
|
@@ -39,8 +42,10 @@ sap.ui.define([], function () { 'use strict';
|
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
const arrayForEach = unapply(Array.prototype.forEach);
|
|
45
|
+
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
42
46
|
const arrayPop = unapply(Array.prototype.pop);
|
|
43
47
|
const arrayPush = unapply(Array.prototype.push);
|
|
48
|
+
const arraySplice = unapply(Array.prototype.splice);
|
|
44
49
|
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
45
50
|
const stringToString = unapply(String.prototype.toString);
|
|
46
51
|
const stringMatch = unapply(String.prototype.match);
|
|
@@ -50,12 +55,11 @@ sap.ui.define([], function () { 'use strict';
|
|
|
50
55
|
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
51
56
|
const regExpTest = unapply(RegExp.prototype.test);
|
|
52
57
|
const typeErrorCreate = unconstruct(TypeError);
|
|
53
|
-
|
|
54
58
|
/**
|
|
55
59
|
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
|
56
60
|
*
|
|
57
|
-
* @param
|
|
58
|
-
* @returns
|
|
61
|
+
* @param func - The function to be wrapped and called.
|
|
62
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
|
59
63
|
*/
|
|
60
64
|
function unapply(func) {
|
|
61
65
|
return function (thisArg) {
|
|
@@ -65,12 +69,11 @@ sap.ui.define([], function () { 'use strict';
|
|
|
65
69
|
return apply(func, thisArg, args);
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
|
-
|
|
69
72
|
/**
|
|
70
73
|
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
|
71
74
|
*
|
|
72
|
-
* @param
|
|
73
|
-
* @returns
|
|
75
|
+
* @param func - The constructor function to be wrapped and called.
|
|
76
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
74
77
|
*/
|
|
75
78
|
function unconstruct(func) {
|
|
76
79
|
return function () {
|
|
@@ -80,14 +83,13 @@ sap.ui.define([], function () { 'use strict';
|
|
|
80
83
|
return construct(func, args);
|
|
81
84
|
};
|
|
82
85
|
}
|
|
83
|
-
|
|
84
86
|
/**
|
|
85
87
|
* Add properties to a lookup table
|
|
86
88
|
*
|
|
87
|
-
* @param
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @returns
|
|
89
|
+
* @param set - The set to which elements will be added.
|
|
90
|
+
* @param array - The array containing elements to be added to the set.
|
|
91
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
|
92
|
+
* @returns The modified set with added elements.
|
|
91
93
|
*/
|
|
92
94
|
function addToSet(set, array) {
|
|
93
95
|
let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
|
@@ -114,12 +116,11 @@ sap.ui.define([], function () { 'use strict';
|
|
|
114
116
|
}
|
|
115
117
|
return set;
|
|
116
118
|
}
|
|
117
|
-
|
|
118
119
|
/**
|
|
119
120
|
* Clean up an array to harden against CSPP
|
|
120
121
|
*
|
|
121
|
-
* @param
|
|
122
|
-
* @returns
|
|
122
|
+
* @param array - The array to be cleaned.
|
|
123
|
+
* @returns The cleaned version of the array
|
|
123
124
|
*/
|
|
124
125
|
function cleanArray(array) {
|
|
125
126
|
for (let index = 0; index < array.length; index++) {
|
|
@@ -130,12 +131,11 @@ sap.ui.define([], function () { 'use strict';
|
|
|
130
131
|
}
|
|
131
132
|
return array;
|
|
132
133
|
}
|
|
133
|
-
|
|
134
134
|
/**
|
|
135
135
|
* Shallow clone an object
|
|
136
136
|
*
|
|
137
|
-
* @param
|
|
138
|
-
* @returns
|
|
137
|
+
* @param object - The object to be cloned.
|
|
138
|
+
* @returns A new object that copies the original.
|
|
139
139
|
*/
|
|
140
140
|
function clone(object) {
|
|
141
141
|
const newObject = create(null);
|
|
@@ -153,13 +153,12 @@ sap.ui.define([], function () { 'use strict';
|
|
|
153
153
|
}
|
|
154
154
|
return newObject;
|
|
155
155
|
}
|
|
156
|
-
|
|
157
156
|
/**
|
|
158
157
|
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
159
158
|
*
|
|
160
|
-
* @param
|
|
161
|
-
* @param
|
|
162
|
-
* @returns
|
|
159
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
|
160
|
+
* @param prop - The property name for which to find the getter function.
|
|
161
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
|
163
162
|
*/
|
|
164
163
|
function lookupGetter(object, prop) {
|
|
165
164
|
while (object !== null) {
|
|
@@ -181,18 +180,14 @@ sap.ui.define([], function () { 'use strict';
|
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
184
|
-
|
|
185
|
-
// SVG
|
|
186
183
|
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
187
184
|
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
188
|
-
|
|
189
185
|
// List of SVG elements that are disallowed by default.
|
|
190
186
|
// We still need to know them so that we can do namespace
|
|
191
187
|
// checks properly in case one wants to add them to
|
|
192
188
|
// allow-list.
|
|
193
189
|
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
|
194
190
|
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
|
|
195
|
-
|
|
196
191
|
// Similarly to SVG, we want to know all MathML elements,
|
|
197
192
|
// even those that we disallow by default.
|
|
198
193
|
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
@@ -206,8 +201,8 @@ sap.ui.define([], function () { 'use strict';
|
|
|
206
201
|
// eslint-disable-next-line unicorn/better-regex
|
|
207
202
|
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
208
203
|
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
209
|
-
const TMPLIT_EXPR = seal(
|
|
210
|
-
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]
|
|
204
|
+
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
205
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
211
206
|
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
212
207
|
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
213
208
|
);
|
|
@@ -219,18 +214,19 @@ sap.ui.define([], function () { 'use strict';
|
|
|
219
214
|
|
|
220
215
|
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
221
216
|
__proto__: null,
|
|
222
|
-
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
223
|
-
ERB_EXPR: ERB_EXPR,
|
|
224
|
-
TMPLIT_EXPR: TMPLIT_EXPR,
|
|
225
|
-
DATA_ATTR: DATA_ATTR,
|
|
226
217
|
ARIA_ATTR: ARIA_ATTR,
|
|
227
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
228
|
-
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
229
218
|
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
219
|
+
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
220
|
+
DATA_ATTR: DATA_ATTR,
|
|
230
221
|
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
231
|
-
|
|
222
|
+
ERB_EXPR: ERB_EXPR,
|
|
223
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
224
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
225
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
226
|
+
TMPLIT_EXPR: TMPLIT_EXPR
|
|
232
227
|
});
|
|
233
228
|
|
|
229
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
234
230
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
235
231
|
const NODE_TYPE = {
|
|
236
232
|
element: 1,
|
|
@@ -251,20 +247,18 @@ sap.ui.define([], function () { 'use strict';
|
|
|
251
247
|
const getGlobal = function getGlobal() {
|
|
252
248
|
return typeof window === 'undefined' ? null : window;
|
|
253
249
|
};
|
|
254
|
-
|
|
255
250
|
/**
|
|
256
251
|
* Creates a no-op policy for internal use only.
|
|
257
252
|
* Don't export this function outside this module!
|
|
258
|
-
* @param
|
|
259
|
-
* @param
|
|
260
|
-
* @return
|
|
253
|
+
* @param trustedTypes The policy factory.
|
|
254
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
|
255
|
+
* @return The policy created (or null, if Trusted Types
|
|
261
256
|
* are not supported or creating the policy failed).
|
|
262
257
|
*/
|
|
263
258
|
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
|
264
259
|
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
265
260
|
return null;
|
|
266
261
|
}
|
|
267
|
-
|
|
268
262
|
// Allow the callers to control the unique policy name
|
|
269
263
|
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
270
264
|
// Policy creation with duplicate names throws in Trusted Types.
|
|
@@ -291,22 +285,25 @@ sap.ui.define([], function () { 'use strict';
|
|
|
291
285
|
return null;
|
|
292
286
|
}
|
|
293
287
|
};
|
|
288
|
+
const _createHooksMap = function _createHooksMap() {
|
|
289
|
+
return {
|
|
290
|
+
afterSanitizeAttributes: [],
|
|
291
|
+
afterSanitizeElements: [],
|
|
292
|
+
afterSanitizeShadowDOM: [],
|
|
293
|
+
beforeSanitizeAttributes: [],
|
|
294
|
+
beforeSanitizeElements: [],
|
|
295
|
+
beforeSanitizeShadowDOM: [],
|
|
296
|
+
uponSanitizeAttribute: [],
|
|
297
|
+
uponSanitizeElement: [],
|
|
298
|
+
uponSanitizeShadowNode: []
|
|
299
|
+
};
|
|
300
|
+
};
|
|
294
301
|
function createDOMPurify() {
|
|
295
302
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
296
303
|
const DOMPurify = root => createDOMPurify(root);
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Version label, exposed for easier checks
|
|
300
|
-
* if DOMPurify is up to date or not
|
|
301
|
-
*/
|
|
302
|
-
DOMPurify.version = '3.1.7';
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Array of elements that DOMPurify removed during sanitation.
|
|
306
|
-
* Empty if nothing was removed.
|
|
307
|
-
*/
|
|
304
|
+
DOMPurify.version = '3.2.4';
|
|
308
305
|
DOMPurify.removed = [];
|
|
309
|
-
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
|
|
306
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
310
307
|
// Not running in a browser, provide a factory function
|
|
311
308
|
// so that you can pass your own Window
|
|
312
309
|
DOMPurify.isSupported = false;
|
|
@@ -334,7 +331,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
334
331
|
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
335
332
|
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
336
333
|
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
337
|
-
|
|
338
334
|
// As per issue #47, the web-components registry is inherited by a
|
|
339
335
|
// new document created via createHTMLDocument. As per the spec
|
|
340
336
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -358,8 +354,7 @@ sap.ui.define([], function () { 'use strict';
|
|
|
358
354
|
const {
|
|
359
355
|
importNode
|
|
360
356
|
} = originalDocument;
|
|
361
|
-
let hooks =
|
|
362
|
-
|
|
357
|
+
let hooks = _createHooksMap();
|
|
363
358
|
/**
|
|
364
359
|
* Expose whether this browser supports running the full DOMPurify.
|
|
365
360
|
*/
|
|
@@ -377,22 +372,18 @@ sap.ui.define([], function () { 'use strict';
|
|
|
377
372
|
let {
|
|
378
373
|
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
379
374
|
} = EXPRESSIONS;
|
|
380
|
-
|
|
381
375
|
/**
|
|
382
376
|
* We consider the elements and attributes below to be safe. Ideally
|
|
383
377
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
384
378
|
*/
|
|
385
|
-
|
|
386
379
|
/* allowed element names */
|
|
387
380
|
let ALLOWED_TAGS = null;
|
|
388
381
|
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
|
389
|
-
|
|
390
382
|
/* Allowed attribute names */
|
|
391
383
|
let ALLOWED_ATTR = null;
|
|
392
384
|
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
|
393
|
-
|
|
394
385
|
/*
|
|
395
|
-
* Configure how
|
|
386
|
+
* Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
|
|
396
387
|
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
|
397
388
|
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
|
398
389
|
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
|
@@ -417,99 +408,77 @@ sap.ui.define([], function () { 'use strict';
|
|
|
417
408
|
value: false
|
|
418
409
|
}
|
|
419
410
|
}));
|
|
420
|
-
|
|
421
411
|
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
422
412
|
let FORBID_TAGS = null;
|
|
423
|
-
|
|
424
413
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
425
414
|
let FORBID_ATTR = null;
|
|
426
|
-
|
|
427
415
|
/* Decide if ARIA attributes are okay */
|
|
428
416
|
let ALLOW_ARIA_ATTR = true;
|
|
429
|
-
|
|
430
417
|
/* Decide if custom data attributes are okay */
|
|
431
418
|
let ALLOW_DATA_ATTR = true;
|
|
432
|
-
|
|
433
419
|
/* Decide if unknown protocols are okay */
|
|
434
420
|
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
435
|
-
|
|
436
421
|
/* Decide if self-closing tags in attributes are allowed.
|
|
437
422
|
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
|
438
423
|
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
439
|
-
|
|
440
424
|
/* Output should be safe for common template engines.
|
|
441
425
|
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
442
426
|
*/
|
|
443
427
|
let SAFE_FOR_TEMPLATES = false;
|
|
444
|
-
|
|
445
428
|
/* Output should be safe even for XML used within HTML and alike.
|
|
446
429
|
* This means, DOMPurify removes comments when containing risky content.
|
|
447
430
|
*/
|
|
448
431
|
let SAFE_FOR_XML = true;
|
|
449
|
-
|
|
450
432
|
/* Decide if document with <html>... should be returned */
|
|
451
433
|
let WHOLE_DOCUMENT = false;
|
|
452
|
-
|
|
453
434
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
454
435
|
let SET_CONFIG = false;
|
|
455
|
-
|
|
456
436
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
457
437
|
* document.body. By default, browsers might move them to document.head */
|
|
458
438
|
let FORCE_BODY = false;
|
|
459
|
-
|
|
460
439
|
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
461
440
|
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
462
441
|
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
463
442
|
*/
|
|
464
443
|
let RETURN_DOM = false;
|
|
465
|
-
|
|
466
444
|
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
467
445
|
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
468
446
|
let RETURN_DOM_FRAGMENT = false;
|
|
469
|
-
|
|
470
447
|
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
471
448
|
* case Trusted Types are not supported */
|
|
472
449
|
let RETURN_TRUSTED_TYPE = false;
|
|
473
|
-
|
|
474
450
|
/* Output should be free from DOM clobbering attacks?
|
|
475
451
|
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
|
476
452
|
*/
|
|
477
453
|
let SANITIZE_DOM = true;
|
|
478
|
-
|
|
479
454
|
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
|
480
455
|
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
|
481
456
|
*
|
|
482
457
|
* HTML/DOM spec rules that enable DOM Clobbering:
|
|
483
|
-
* - Named Access on Window (
|
|
484
|
-
* - DOM Tree Accessors (
|
|
485
|
-
* - Form Element Parent-Child Relations (
|
|
486
|
-
* - Iframe srcdoc / Nested WindowProxies (
|
|
487
|
-
* - HTMLCollection (
|
|
458
|
+
* - Named Access on Window (§7.3.3)
|
|
459
|
+
* - DOM Tree Accessors (§3.1.5)
|
|
460
|
+
* - Form Element Parent-Child Relations (§4.10.3)
|
|
461
|
+
* - Iframe srcdoc / Nested WindowProxies (§4.8.5)
|
|
462
|
+
* - HTMLCollection (§4.2.10.2)
|
|
488
463
|
*
|
|
489
464
|
* Namespace isolation is implemented by prefixing `id` and `name` attributes
|
|
490
465
|
* with a constant string, i.e., `user-content-`
|
|
491
466
|
*/
|
|
492
467
|
let SANITIZE_NAMED_PROPS = false;
|
|
493
468
|
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
|
494
|
-
|
|
495
469
|
/* Keep element content when removing element? */
|
|
496
470
|
let KEEP_CONTENT = true;
|
|
497
|
-
|
|
498
471
|
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
499
472
|
* of importing it into a new Document and returning a sanitized copy */
|
|
500
473
|
let IN_PLACE = false;
|
|
501
|
-
|
|
502
474
|
/* Allow usage of profiles like html, svg and mathMl */
|
|
503
475
|
let USE_PROFILES = {};
|
|
504
|
-
|
|
505
476
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
506
477
|
let FORBID_CONTENTS = null;
|
|
507
478
|
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
508
|
-
|
|
509
479
|
/* Tags that are safe for data: URIs */
|
|
510
480
|
let DATA_URI_TAGS = null;
|
|
511
481
|
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
512
|
-
|
|
513
482
|
/* Attributes safe for values like "javascript:" */
|
|
514
483
|
let URI_SAFE_ATTRIBUTES = null;
|
|
515
484
|
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
@@ -519,32 +488,33 @@ sap.ui.define([], function () { 'use strict';
|
|
|
519
488
|
/* Document namespace */
|
|
520
489
|
let NAMESPACE = HTML_NAMESPACE;
|
|
521
490
|
let IS_EMPTY_INPUT = false;
|
|
522
|
-
|
|
523
491
|
/* Allowed XHTML+XML namespaces */
|
|
524
492
|
let ALLOWED_NAMESPACES = null;
|
|
525
493
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
526
|
-
|
|
494
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
495
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
|
496
|
+
// Certain elements are allowed in both SVG and HTML
|
|
497
|
+
// namespace. We need to specify them explicitly
|
|
498
|
+
// so that they don't get erroneously deleted from
|
|
499
|
+
// HTML namespace.
|
|
500
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
527
501
|
/* Parsing of strict XHTML documents */
|
|
528
502
|
let PARSER_MEDIA_TYPE = null;
|
|
529
503
|
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
|
530
504
|
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
|
531
505
|
let transformCaseFunc = null;
|
|
532
|
-
|
|
533
506
|
/* Keep a reference to config to pass to hooks */
|
|
534
507
|
let CONFIG = null;
|
|
535
|
-
|
|
536
508
|
/* Ideally, do not touch anything below this line */
|
|
537
509
|
/* ______________________________________________ */
|
|
538
|
-
|
|
539
510
|
const formElement = document.createElement('form');
|
|
540
511
|
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
541
512
|
return testValue instanceof RegExp || testValue instanceof Function;
|
|
542
513
|
};
|
|
543
|
-
|
|
544
514
|
/**
|
|
545
515
|
* _parseConfig
|
|
546
516
|
*
|
|
547
|
-
* @param
|
|
517
|
+
* @param cfg optional config literal
|
|
548
518
|
*/
|
|
549
519
|
// eslint-disable-next-line complexity
|
|
550
520
|
const _parseConfig = function _parseConfig() {
|
|
@@ -552,39 +522,23 @@ sap.ui.define([], function () { 'use strict';
|
|
|
552
522
|
if (CONFIG && CONFIG === cfg) {
|
|
553
523
|
return;
|
|
554
524
|
}
|
|
555
|
-
|
|
556
525
|
/* Shield configuration object from tampering */
|
|
557
526
|
if (!cfg || typeof cfg !== 'object') {
|
|
558
527
|
cfg = {};
|
|
559
528
|
}
|
|
560
|
-
|
|
561
529
|
/* Shield configuration object from prototype pollution */
|
|
562
530
|
cfg = clone(cfg);
|
|
563
531
|
PARSER_MEDIA_TYPE =
|
|
564
532
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
565
533
|
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
566
|
-
|
|
567
534
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
568
535
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
569
|
-
|
|
570
536
|
/* Set configuration parameters */
|
|
571
537
|
ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
572
538
|
ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
573
539
|
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
574
|
-
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),
|
|
575
|
-
|
|
576
|
-
cfg.ADD_URI_SAFE_ATTR,
|
|
577
|
-
// eslint-disable-line indent
|
|
578
|
-
transformCaseFunc // eslint-disable-line indent
|
|
579
|
-
) // eslint-disable-line indent
|
|
580
|
-
: DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
581
|
-
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),
|
|
582
|
-
// eslint-disable-line indent
|
|
583
|
-
cfg.ADD_DATA_URI_TAGS,
|
|
584
|
-
// eslint-disable-line indent
|
|
585
|
-
transformCaseFunc // eslint-disable-line indent
|
|
586
|
-
) // eslint-disable-line indent
|
|
587
|
-
: DEFAULT_DATA_URI_TAGS;
|
|
540
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
541
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
|
588
542
|
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
589
543
|
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
|
|
590
544
|
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
|
|
@@ -606,6 +560,8 @@ sap.ui.define([], function () { 'use strict';
|
|
|
606
560
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
607
561
|
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
608
562
|
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
563
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
564
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
609
565
|
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
610
566
|
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
611
567
|
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
@@ -622,7 +578,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
622
578
|
if (RETURN_DOM_FRAGMENT) {
|
|
623
579
|
RETURN_DOM = true;
|
|
624
580
|
}
|
|
625
|
-
|
|
626
581
|
/* Parse profile info */
|
|
627
582
|
if (USE_PROFILES) {
|
|
628
583
|
ALLOWED_TAGS = addToSet({}, text);
|
|
@@ -647,7 +602,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
647
602
|
addToSet(ALLOWED_ATTR, xml);
|
|
648
603
|
}
|
|
649
604
|
}
|
|
650
|
-
|
|
651
605
|
/* Merge configuration parameters */
|
|
652
606
|
if (cfg.ADD_TAGS) {
|
|
653
607
|
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
@@ -670,17 +624,14 @@ sap.ui.define([], function () { 'use strict';
|
|
|
670
624
|
}
|
|
671
625
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
672
626
|
}
|
|
673
|
-
|
|
674
627
|
/* Add #text in case KEEP_CONTENT is set to true */
|
|
675
628
|
if (KEEP_CONTENT) {
|
|
676
629
|
ALLOWED_TAGS['#text'] = true;
|
|
677
630
|
}
|
|
678
|
-
|
|
679
631
|
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
|
680
632
|
if (WHOLE_DOCUMENT) {
|
|
681
633
|
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
|
682
634
|
}
|
|
683
|
-
|
|
684
635
|
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
|
685
636
|
if (ALLOWED_TAGS.table) {
|
|
686
637
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
@@ -693,10 +644,8 @@ sap.ui.define([], function () { 'use strict';
|
|
|
693
644
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
694
645
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
695
646
|
}
|
|
696
|
-
|
|
697
647
|
// Overwrite existing TrustedTypes policy.
|
|
698
648
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
699
|
-
|
|
700
649
|
// Sign local variables required by `sanitize`.
|
|
701
650
|
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
702
651
|
} else {
|
|
@@ -704,13 +653,11 @@ sap.ui.define([], function () { 'use strict';
|
|
|
704
653
|
if (trustedTypesPolicy === undefined) {
|
|
705
654
|
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
706
655
|
}
|
|
707
|
-
|
|
708
656
|
// If creating the internal policy succeeded sign internal variables.
|
|
709
657
|
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
|
710
658
|
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
711
659
|
}
|
|
712
660
|
}
|
|
713
|
-
|
|
714
661
|
// Prevent further manipulation of configuration.
|
|
715
662
|
// Not available in IE8, Safari 5, etc.
|
|
716
663
|
if (freeze) {
|
|
@@ -718,30 +665,19 @@ sap.ui.define([], function () { 'use strict';
|
|
|
718
665
|
}
|
|
719
666
|
CONFIG = cfg;
|
|
720
667
|
};
|
|
721
|
-
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
722
|
-
const HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
|
723
|
-
|
|
724
|
-
// Certain elements are allowed in both SVG and HTML
|
|
725
|
-
// namespace. We need to specify them explicitly
|
|
726
|
-
// so that they don't get erroneously deleted from
|
|
727
|
-
// HTML namespace.
|
|
728
|
-
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
729
|
-
|
|
730
668
|
/* Keep track of all possible SVG and MathML tags
|
|
731
669
|
* so that we can perform the namespace checks
|
|
732
670
|
* correctly. */
|
|
733
671
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
734
672
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
735
|
-
|
|
736
673
|
/**
|
|
737
|
-
* @param
|
|
738
|
-
* @returns
|
|
674
|
+
* @param element a DOM element whose namespace is being checked
|
|
675
|
+
* @returns Return false if the element has a
|
|
739
676
|
* namespace that a spec-compliant parser would never
|
|
740
677
|
* return. Return true otherwise.
|
|
741
678
|
*/
|
|
742
679
|
const _checkValidNamespace = function _checkValidNamespace(element) {
|
|
743
680
|
let parent = getParentNode(element);
|
|
744
|
-
|
|
745
681
|
// In JSDOM, if we're inside shadow DOM, then parentNode
|
|
746
682
|
// can be null. We just simulate parent in this case.
|
|
747
683
|
if (!parent || !parent.tagName) {
|
|
@@ -762,14 +698,12 @@ sap.ui.define([], function () { 'use strict';
|
|
|
762
698
|
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
763
699
|
return tagName === 'svg';
|
|
764
700
|
}
|
|
765
|
-
|
|
766
701
|
// The only way to switch from MathML to SVG is via`
|
|
767
702
|
// svg if parent is either <annotation-xml> or MathML
|
|
768
703
|
// text integration points.
|
|
769
704
|
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
770
705
|
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
771
706
|
}
|
|
772
|
-
|
|
773
707
|
// We only allow elements that are defined in SVG
|
|
774
708
|
// spec. All others are disallowed in SVG namespace.
|
|
775
709
|
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
@@ -781,13 +715,11 @@ sap.ui.define([], function () { 'use strict';
|
|
|
781
715
|
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
782
716
|
return tagName === 'math';
|
|
783
717
|
}
|
|
784
|
-
|
|
785
718
|
// The only way to switch from SVG to MathML is via
|
|
786
719
|
// <math> and HTML integration points
|
|
787
720
|
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
788
721
|
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
789
722
|
}
|
|
790
|
-
|
|
791
723
|
// We only allow elements that are defined in MathML
|
|
792
724
|
// spec. All others are disallowed in MathML namespace.
|
|
793
725
|
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
@@ -802,28 +734,24 @@ sap.ui.define([], function () { 'use strict';
|
|
|
802
734
|
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
803
735
|
return false;
|
|
804
736
|
}
|
|
805
|
-
|
|
806
737
|
// We disallow tags that are specific for MathML
|
|
807
738
|
// or SVG and should never appear in HTML namespace
|
|
808
739
|
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
809
740
|
}
|
|
810
|
-
|
|
811
741
|
// For XHTML and XML documents that support custom namespaces
|
|
812
742
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
813
743
|
return true;
|
|
814
744
|
}
|
|
815
|
-
|
|
816
745
|
// The code should never reach this place (this means
|
|
817
746
|
// that the element somehow got namespace that is not
|
|
818
747
|
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
|
819
748
|
// Return false just in case.
|
|
820
749
|
return false;
|
|
821
750
|
};
|
|
822
|
-
|
|
823
751
|
/**
|
|
824
752
|
* _forceRemove
|
|
825
753
|
*
|
|
826
|
-
* @param
|
|
754
|
+
* @param node a DOM node
|
|
827
755
|
*/
|
|
828
756
|
const _forceRemove = function _forceRemove(node) {
|
|
829
757
|
arrayPush(DOMPurify.removed, {
|
|
@@ -836,46 +764,43 @@ sap.ui.define([], function () { 'use strict';
|
|
|
836
764
|
remove(node);
|
|
837
765
|
}
|
|
838
766
|
};
|
|
839
|
-
|
|
840
767
|
/**
|
|
841
768
|
* _removeAttribute
|
|
842
769
|
*
|
|
843
|
-
* @param
|
|
844
|
-
* @param
|
|
770
|
+
* @param name an Attribute name
|
|
771
|
+
* @param element a DOM node
|
|
845
772
|
*/
|
|
846
|
-
const _removeAttribute = function _removeAttribute(name,
|
|
773
|
+
const _removeAttribute = function _removeAttribute(name, element) {
|
|
847
774
|
try {
|
|
848
775
|
arrayPush(DOMPurify.removed, {
|
|
849
|
-
attribute:
|
|
850
|
-
from:
|
|
776
|
+
attribute: element.getAttributeNode(name),
|
|
777
|
+
from: element
|
|
851
778
|
});
|
|
852
779
|
} catch (_) {
|
|
853
780
|
arrayPush(DOMPurify.removed, {
|
|
854
781
|
attribute: null,
|
|
855
|
-
from:
|
|
782
|
+
from: element
|
|
856
783
|
});
|
|
857
784
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
if (name === 'is' && !ALLOWED_ATTR[name]) {
|
|
785
|
+
element.removeAttribute(name);
|
|
786
|
+
// We void attribute values for unremovable "is" attributes
|
|
787
|
+
if (name === 'is') {
|
|
862
788
|
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
863
789
|
try {
|
|
864
|
-
_forceRemove(
|
|
790
|
+
_forceRemove(element);
|
|
865
791
|
} catch (_) {}
|
|
866
792
|
} else {
|
|
867
793
|
try {
|
|
868
|
-
|
|
794
|
+
element.setAttribute(name, '');
|
|
869
795
|
} catch (_) {}
|
|
870
796
|
}
|
|
871
797
|
}
|
|
872
798
|
};
|
|
873
|
-
|
|
874
799
|
/**
|
|
875
800
|
* _initDocument
|
|
876
801
|
*
|
|
877
|
-
* @param
|
|
878
|
-
* @return
|
|
802
|
+
* @param dirty - a string of dirty markup
|
|
803
|
+
* @return a DOM, filled with the dirty markup
|
|
879
804
|
*/
|
|
880
805
|
const _initDocument = function _initDocument(dirty) {
|
|
881
806
|
/* Create a HTML document */
|
|
@@ -902,7 +827,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
902
827
|
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
903
828
|
} catch (_) {}
|
|
904
829
|
}
|
|
905
|
-
|
|
906
830
|
/* Use createHTMLDocument in case DOMParser is not available */
|
|
907
831
|
if (!doc || !doc.documentElement) {
|
|
908
832
|
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
|
@@ -916,112 +840,86 @@ sap.ui.define([], function () { 'use strict';
|
|
|
916
840
|
if (dirty && leadingWhitespace) {
|
|
917
841
|
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
918
842
|
}
|
|
919
|
-
|
|
920
843
|
/* Work on whole document or just its body */
|
|
921
844
|
if (NAMESPACE === HTML_NAMESPACE) {
|
|
922
845
|
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
|
923
846
|
}
|
|
924
847
|
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
925
848
|
};
|
|
926
|
-
|
|
927
849
|
/**
|
|
928
850
|
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
|
929
851
|
*
|
|
930
|
-
* @param
|
|
931
|
-
* @return
|
|
852
|
+
* @param root The root element or node to start traversing on.
|
|
853
|
+
* @return The created NodeIterator
|
|
932
854
|
*/
|
|
933
855
|
const _createNodeIterator = function _createNodeIterator(root) {
|
|
934
856
|
return createNodeIterator.call(root.ownerDocument || root, root,
|
|
935
857
|
// eslint-disable-next-line no-bitwise
|
|
936
858
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
937
859
|
};
|
|
938
|
-
|
|
939
860
|
/**
|
|
940
861
|
* _isClobbered
|
|
941
862
|
*
|
|
942
|
-
* @param
|
|
943
|
-
* @return
|
|
863
|
+
* @param element element to check for clobbering attacks
|
|
864
|
+
* @return true if clobbered, false if safe
|
|
944
865
|
*/
|
|
945
|
-
const _isClobbered = function _isClobbered(
|
|
946
|
-
return
|
|
866
|
+
const _isClobbered = function _isClobbered(element) {
|
|
867
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
|
|
947
868
|
};
|
|
948
|
-
|
|
949
869
|
/**
|
|
950
870
|
* Checks whether the given object is a DOM node.
|
|
951
871
|
*
|
|
952
|
-
* @param
|
|
953
|
-
* @return
|
|
872
|
+
* @param value object to check whether it's a DOM node
|
|
873
|
+
* @return true is object is a DOM node
|
|
954
874
|
*/
|
|
955
|
-
const _isNode = function _isNode(
|
|
956
|
-
return typeof Node === 'function' &&
|
|
875
|
+
const _isNode = function _isNode(value) {
|
|
876
|
+
return typeof Node === 'function' && value instanceof Node;
|
|
957
877
|
};
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
* _executeHook
|
|
961
|
-
* Execute user configurable hooks
|
|
962
|
-
*
|
|
963
|
-
* @param {String} entryPoint Name of the hook's entry point
|
|
964
|
-
* @param {Node} currentNode node to work on with the hook
|
|
965
|
-
* @param {Object} data additional hook parameters
|
|
966
|
-
*/
|
|
967
|
-
const _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
|
968
|
-
if (!hooks[entryPoint]) {
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
arrayForEach(hooks[entryPoint], hook => {
|
|
878
|
+
function _executeHooks(hooks, currentNode, data) {
|
|
879
|
+
arrayForEach(hooks, hook => {
|
|
972
880
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
973
881
|
});
|
|
974
|
-
}
|
|
975
|
-
|
|
882
|
+
}
|
|
976
883
|
/**
|
|
977
884
|
* _sanitizeElements
|
|
978
885
|
*
|
|
979
886
|
* @protect nodeName
|
|
980
887
|
* @protect textContent
|
|
981
888
|
* @protect removeChild
|
|
982
|
-
*
|
|
983
|
-
* @
|
|
984
|
-
* @return {Boolean} true if node was killed, false if left alive
|
|
889
|
+
* @param currentNode to check for permission to exist
|
|
890
|
+
* @return true if node was killed, false if left alive
|
|
985
891
|
*/
|
|
986
892
|
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
987
893
|
let content = null;
|
|
988
|
-
|
|
989
894
|
/* Execute a hook if present */
|
|
990
|
-
|
|
991
|
-
|
|
895
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
992
896
|
/* Check if element is clobbered or can clobber */
|
|
993
897
|
if (_isClobbered(currentNode)) {
|
|
994
898
|
_forceRemove(currentNode);
|
|
995
899
|
return true;
|
|
996
900
|
}
|
|
997
|
-
|
|
998
901
|
/* Now let's check the element's type and name */
|
|
999
902
|
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1000
|
-
|
|
1001
903
|
/* Execute a hook if present */
|
|
1002
|
-
|
|
904
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
1003
905
|
tagName,
|
|
1004
906
|
allowedTags: ALLOWED_TAGS
|
|
1005
907
|
});
|
|
1006
|
-
|
|
1007
908
|
/* Detect mXSS attempts abusing namespace confusion */
|
|
1008
|
-
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
|
|
909
|
+
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
|
1009
910
|
_forceRemove(currentNode);
|
|
1010
911
|
return true;
|
|
1011
912
|
}
|
|
1012
|
-
|
|
1013
913
|
/* Remove any occurrence of processing instructions */
|
|
1014
914
|
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
1015
915
|
_forceRemove(currentNode);
|
|
1016
916
|
return true;
|
|
1017
917
|
}
|
|
1018
|
-
|
|
1019
918
|
/* Remove any kind of possibly harmful comments */
|
|
1020
919
|
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
1021
920
|
_forceRemove(currentNode);
|
|
1022
921
|
return true;
|
|
1023
922
|
}
|
|
1024
|
-
|
|
1025
923
|
/* Remove element if anything forbids its presence */
|
|
1026
924
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
1027
925
|
/* Check if we have a custom element to handle */
|
|
@@ -1033,7 +931,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1033
931
|
return false;
|
|
1034
932
|
}
|
|
1035
933
|
}
|
|
1036
|
-
|
|
1037
934
|
/* Keep content except for bad-listed elements */
|
|
1038
935
|
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1039
936
|
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
@@ -1050,19 +947,16 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1050
947
|
_forceRemove(currentNode);
|
|
1051
948
|
return true;
|
|
1052
949
|
}
|
|
1053
|
-
|
|
1054
950
|
/* Check whether element has a valid namespace */
|
|
1055
951
|
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
1056
952
|
_forceRemove(currentNode);
|
|
1057
953
|
return true;
|
|
1058
954
|
}
|
|
1059
|
-
|
|
1060
955
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
1061
956
|
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
|
1062
957
|
_forceRemove(currentNode);
|
|
1063
958
|
return true;
|
|
1064
959
|
}
|
|
1065
|
-
|
|
1066
960
|
/* Sanitize element content to be template-safe */
|
|
1067
961
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
1068
962
|
/* Get the element's text content */
|
|
@@ -1077,19 +971,17 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1077
971
|
currentNode.textContent = content;
|
|
1078
972
|
}
|
|
1079
973
|
}
|
|
1080
|
-
|
|
1081
974
|
/* Execute a hook if present */
|
|
1082
|
-
|
|
975
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
1083
976
|
return false;
|
|
1084
977
|
};
|
|
1085
|
-
|
|
1086
978
|
/**
|
|
1087
979
|
* _isValidAttribute
|
|
1088
980
|
*
|
|
1089
|
-
* @param
|
|
1090
|
-
* @param
|
|
1091
|
-
* @param
|
|
1092
|
-
* @return
|
|
981
|
+
* @param lcTag Lowercase tag name of containing element.
|
|
982
|
+
* @param lcName Lowercase attribute name.
|
|
983
|
+
* @param value Attribute value.
|
|
984
|
+
* @return Returns true if `value` is valid, otherwise false.
|
|
1093
985
|
*/
|
|
1094
986
|
// eslint-disable-next-line complexity
|
|
1095
987
|
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
@@ -1097,7 +989,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1097
989
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
1098
990
|
return false;
|
|
1099
991
|
}
|
|
1100
|
-
|
|
1101
992
|
/* Allow valid data-* attributes: At least one character after "-"
|
|
1102
993
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
1103
994
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
@@ -1119,19 +1010,17 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1119
1010
|
} else ;
|
|
1120
1011
|
return true;
|
|
1121
1012
|
};
|
|
1122
|
-
|
|
1123
1013
|
/**
|
|
1124
1014
|
* _isBasicCustomElement
|
|
1125
1015
|
* checks if at least one dash is included in tagName, and it's not the first char
|
|
1126
1016
|
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
|
1127
1017
|
*
|
|
1128
|
-
* @param
|
|
1129
|
-
* @returns
|
|
1018
|
+
* @param tagName name of the tag of the node to sanitize
|
|
1019
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
1130
1020
|
*/
|
|
1131
1021
|
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
1132
1022
|
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
|
1133
1023
|
};
|
|
1134
|
-
|
|
1135
1024
|
/**
|
|
1136
1025
|
* _sanitizeAttributes
|
|
1137
1026
|
*
|
|
@@ -1140,27 +1029,26 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1140
1029
|
* @protect removeAttribute
|
|
1141
1030
|
* @protect setAttribute
|
|
1142
1031
|
*
|
|
1143
|
-
* @param
|
|
1032
|
+
* @param currentNode to sanitize
|
|
1144
1033
|
*/
|
|
1145
1034
|
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
1146
1035
|
/* Execute a hook if present */
|
|
1147
|
-
|
|
1036
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
1148
1037
|
const {
|
|
1149
1038
|
attributes
|
|
1150
1039
|
} = currentNode;
|
|
1151
|
-
|
|
1152
1040
|
/* Check if we have attributes; if not we might have a text node */
|
|
1153
|
-
if (!attributes) {
|
|
1041
|
+
if (!attributes || _isClobbered(currentNode)) {
|
|
1154
1042
|
return;
|
|
1155
1043
|
}
|
|
1156
1044
|
const hookEvent = {
|
|
1157
1045
|
attrName: '',
|
|
1158
1046
|
attrValue: '',
|
|
1159
1047
|
keepAttr: true,
|
|
1160
|
-
allowedAttributes: ALLOWED_ATTR
|
|
1048
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
1049
|
+
forceKeepAttr: undefined
|
|
1161
1050
|
};
|
|
1162
1051
|
let l = attributes.length;
|
|
1163
|
-
|
|
1164
1052
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
1165
1053
|
while (l--) {
|
|
1166
1054
|
const attr = attributes[l];
|
|
@@ -1171,64 +1059,53 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1171
1059
|
} = attr;
|
|
1172
1060
|
const lcName = transformCaseFunc(name);
|
|
1173
1061
|
let value = name === 'value' ? attrValue : stringTrim(attrValue);
|
|
1174
|
-
|
|
1175
1062
|
/* Execute a hook if present */
|
|
1176
1063
|
hookEvent.attrName = lcName;
|
|
1177
1064
|
hookEvent.attrValue = value;
|
|
1178
1065
|
hookEvent.keepAttr = true;
|
|
1179
1066
|
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
|
1180
|
-
|
|
1067
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
1181
1068
|
value = hookEvent.attrValue;
|
|
1182
|
-
|
|
1069
|
+
/* Full DOM Clobbering protection via namespace isolation,
|
|
1070
|
+
* Prefix id and name attributes with `user-content-`
|
|
1071
|
+
*/
|
|
1072
|
+
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
1073
|
+
// Remove the attribute with this value
|
|
1074
|
+
_removeAttribute(name, currentNode);
|
|
1075
|
+
// Prefix the value and later re-create the attribute with the sanitized value
|
|
1076
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
1077
|
+
}
|
|
1078
|
+
/* Work around a security issue with comments inside attributes */
|
|
1079
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
1080
|
+
_removeAttribute(name, currentNode);
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1183
1083
|
/* Did the hooks approve of the attribute? */
|
|
1184
1084
|
if (hookEvent.forceKeepAttr) {
|
|
1185
1085
|
continue;
|
|
1186
1086
|
}
|
|
1187
|
-
|
|
1188
1087
|
/* Remove attribute */
|
|
1189
1088
|
_removeAttribute(name, currentNode);
|
|
1190
|
-
|
|
1191
1089
|
/* Did the hooks approve of the attribute? */
|
|
1192
1090
|
if (!hookEvent.keepAttr) {
|
|
1193
1091
|
continue;
|
|
1194
1092
|
}
|
|
1195
|
-
|
|
1196
1093
|
/* Work around a security issue in jQuery 3.0 */
|
|
1197
1094
|
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
1198
1095
|
_removeAttribute(name, currentNode);
|
|
1199
1096
|
continue;
|
|
1200
1097
|
}
|
|
1201
|
-
|
|
1202
1098
|
/* Sanitize attribute content to be template-safe */
|
|
1203
1099
|
if (SAFE_FOR_TEMPLATES) {
|
|
1204
1100
|
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
1205
1101
|
value = stringReplace(value, expr, ' ');
|
|
1206
1102
|
});
|
|
1207
1103
|
}
|
|
1208
|
-
|
|
1209
1104
|
/* Is `value` valid for this attribute? */
|
|
1210
1105
|
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1211
1106
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1212
1107
|
continue;
|
|
1213
1108
|
}
|
|
1214
|
-
|
|
1215
|
-
/* Full DOM Clobbering protection via namespace isolation,
|
|
1216
|
-
* Prefix id and name attributes with `user-content-`
|
|
1217
|
-
*/
|
|
1218
|
-
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
1219
|
-
// Remove the attribute with this value
|
|
1220
|
-
_removeAttribute(name, currentNode);
|
|
1221
|
-
|
|
1222
|
-
// Prefix the value and later re-create the attribute with the sanitized value
|
|
1223
|
-
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
/* Work around a security issue with comments inside attributes */
|
|
1227
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
1228
|
-
_removeAttribute(name, currentNode);
|
|
1229
|
-
continue;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
1109
|
/* Handle attributes that require Trusted Types */
|
|
1233
1110
|
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
1234
1111
|
if (namespaceURI) ; else {
|
|
@@ -1246,7 +1123,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1246
1123
|
}
|
|
1247
1124
|
}
|
|
1248
1125
|
}
|
|
1249
|
-
|
|
1250
1126
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
1251
1127
|
try {
|
|
1252
1128
|
if (namespaceURI) {
|
|
@@ -1262,51 +1138,34 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1262
1138
|
}
|
|
1263
1139
|
} catch (_) {}
|
|
1264
1140
|
}
|
|
1265
|
-
|
|
1266
1141
|
/* Execute a hook if present */
|
|
1267
|
-
|
|
1142
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
1268
1143
|
};
|
|
1269
|
-
|
|
1270
1144
|
/**
|
|
1271
1145
|
* _sanitizeShadowDOM
|
|
1272
1146
|
*
|
|
1273
|
-
* @param
|
|
1147
|
+
* @param fragment to iterate over recursively
|
|
1274
1148
|
*/
|
|
1275
1149
|
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
1276
1150
|
let shadowNode = null;
|
|
1277
1151
|
const shadowIterator = _createNodeIterator(fragment);
|
|
1278
|
-
|
|
1279
1152
|
/* Execute a hook if present */
|
|
1280
|
-
|
|
1153
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
1281
1154
|
while (shadowNode = shadowIterator.nextNode()) {
|
|
1282
1155
|
/* Execute a hook if present */
|
|
1283
|
-
|
|
1284
|
-
|
|
1156
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
1285
1157
|
/* Sanitize tags and elements */
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1158
|
+
_sanitizeElements(shadowNode);
|
|
1159
|
+
/* Check attributes next */
|
|
1160
|
+
_sanitizeAttributes(shadowNode);
|
|
1290
1161
|
/* Deep shadow DOM detected */
|
|
1291
1162
|
if (shadowNode.content instanceof DocumentFragment) {
|
|
1292
1163
|
_sanitizeShadowDOM(shadowNode.content);
|
|
1293
1164
|
}
|
|
1294
|
-
|
|
1295
|
-
/* Check attributes, sanitize if necessary */
|
|
1296
|
-
_sanitizeAttributes(shadowNode);
|
|
1297
1165
|
}
|
|
1298
|
-
|
|
1299
1166
|
/* Execute a hook if present */
|
|
1300
|
-
|
|
1167
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
1301
1168
|
};
|
|
1302
|
-
|
|
1303
|
-
/**
|
|
1304
|
-
* Sanitize
|
|
1305
|
-
* Public method providing core sanitation functionality
|
|
1306
|
-
*
|
|
1307
|
-
* @param {String|Node} dirty string or DOM node
|
|
1308
|
-
* @param {Object} cfg object
|
|
1309
|
-
*/
|
|
1310
1169
|
// eslint-disable-next-line complexity
|
|
1311
1170
|
DOMPurify.sanitize = function (dirty) {
|
|
1312
1171
|
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -1321,7 +1180,6 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1321
1180
|
if (IS_EMPTY_INPUT) {
|
|
1322
1181
|
dirty = '<!-->';
|
|
1323
1182
|
}
|
|
1324
|
-
|
|
1325
1183
|
/* Stringify, in case dirty is an object */
|
|
1326
1184
|
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
|
1327
1185
|
if (typeof dirty.toString === 'function') {
|
|
@@ -1333,20 +1191,16 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1333
1191
|
throw typeErrorCreate('toString is not a function');
|
|
1334
1192
|
}
|
|
1335
1193
|
}
|
|
1336
|
-
|
|
1337
1194
|
/* Return dirty HTML if DOMPurify cannot run */
|
|
1338
1195
|
if (!DOMPurify.isSupported) {
|
|
1339
1196
|
return dirty;
|
|
1340
1197
|
}
|
|
1341
|
-
|
|
1342
1198
|
/* Assign config vars */
|
|
1343
1199
|
if (!SET_CONFIG) {
|
|
1344
1200
|
_parseConfig(cfg);
|
|
1345
1201
|
}
|
|
1346
|
-
|
|
1347
1202
|
/* Clean up removed elements */
|
|
1348
1203
|
DOMPurify.removed = [];
|
|
1349
|
-
|
|
1350
1204
|
/* Check if dirty is correctly typed for IN_PLACE */
|
|
1351
1205
|
if (typeof dirty === 'string') {
|
|
1352
1206
|
IN_PLACE = false;
|
|
@@ -1380,45 +1234,34 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1380
1234
|
dirty.indexOf('<') === -1) {
|
|
1381
1235
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
1382
1236
|
}
|
|
1383
|
-
|
|
1384
1237
|
/* Initialize the document to work on */
|
|
1385
1238
|
body = _initDocument(dirty);
|
|
1386
|
-
|
|
1387
1239
|
/* Check we have a DOM node from the data */
|
|
1388
1240
|
if (!body) {
|
|
1389
1241
|
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
|
1390
1242
|
}
|
|
1391
1243
|
}
|
|
1392
|
-
|
|
1393
1244
|
/* Remove first element node (ours) if FORCE_BODY is set */
|
|
1394
1245
|
if (body && FORCE_BODY) {
|
|
1395
1246
|
_forceRemove(body.firstChild);
|
|
1396
1247
|
}
|
|
1397
|
-
|
|
1398
1248
|
/* Get node iterator */
|
|
1399
1249
|
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
|
1400
|
-
|
|
1401
1250
|
/* Now start iterating over the created document */
|
|
1402
1251
|
while (currentNode = nodeIterator.nextNode()) {
|
|
1403
1252
|
/* Sanitize tags and elements */
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1253
|
+
_sanitizeElements(currentNode);
|
|
1254
|
+
/* Check attributes next */
|
|
1255
|
+
_sanitizeAttributes(currentNode);
|
|
1408
1256
|
/* Shadow DOM detected, sanitize it */
|
|
1409
1257
|
if (currentNode.content instanceof DocumentFragment) {
|
|
1410
1258
|
_sanitizeShadowDOM(currentNode.content);
|
|
1411
1259
|
}
|
|
1412
|
-
|
|
1413
|
-
/* Check attributes, sanitize if necessary */
|
|
1414
|
-
_sanitizeAttributes(currentNode);
|
|
1415
1260
|
}
|
|
1416
|
-
|
|
1417
1261
|
/* If we sanitized `dirty` in-place, return it. */
|
|
1418
1262
|
if (IN_PLACE) {
|
|
1419
1263
|
return dirty;
|
|
1420
1264
|
}
|
|
1421
|
-
|
|
1422
1265
|
/* Return sanitized string or DOM */
|
|
1423
1266
|
if (RETURN_DOM) {
|
|
1424
1267
|
if (RETURN_DOM_FRAGMENT) {
|
|
@@ -1443,12 +1286,10 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1443
1286
|
return returnNode;
|
|
1444
1287
|
}
|
|
1445
1288
|
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
1446
|
-
|
|
1447
1289
|
/* Serialize doctype if allowed */
|
|
1448
1290
|
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
1449
1291
|
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
|
1450
1292
|
}
|
|
1451
|
-
|
|
1452
1293
|
/* Sanitize final string template-safe */
|
|
1453
1294
|
if (SAFE_FOR_TEMPLATES) {
|
|
1454
1295
|
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
@@ -1457,39 +1298,15 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1457
1298
|
}
|
|
1458
1299
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
1459
1300
|
};
|
|
1460
|
-
|
|
1461
|
-
/**
|
|
1462
|
-
* Public method to set the configuration once
|
|
1463
|
-
* setConfig
|
|
1464
|
-
*
|
|
1465
|
-
* @param {Object} cfg configuration object
|
|
1466
|
-
*/
|
|
1467
1301
|
DOMPurify.setConfig = function () {
|
|
1468
1302
|
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1469
1303
|
_parseConfig(cfg);
|
|
1470
1304
|
SET_CONFIG = true;
|
|
1471
1305
|
};
|
|
1472
|
-
|
|
1473
|
-
/**
|
|
1474
|
-
* Public method to remove the configuration
|
|
1475
|
-
* clearConfig
|
|
1476
|
-
*
|
|
1477
|
-
*/
|
|
1478
1306
|
DOMPurify.clearConfig = function () {
|
|
1479
1307
|
CONFIG = null;
|
|
1480
1308
|
SET_CONFIG = false;
|
|
1481
1309
|
};
|
|
1482
|
-
|
|
1483
|
-
/**
|
|
1484
|
-
* Public method to check if an attribute value is valid.
|
|
1485
|
-
* Uses last set config, if any. Otherwise, uses config defaults.
|
|
1486
|
-
* isValidAttribute
|
|
1487
|
-
*
|
|
1488
|
-
* @param {String} tag Tag name of containing element.
|
|
1489
|
-
* @param {String} attr Attribute name.
|
|
1490
|
-
* @param {String} value Attribute value.
|
|
1491
|
-
* @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
|
|
1492
|
-
*/
|
|
1493
1310
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
1494
1311
|
/* Initialize shared config vars if necessary. */
|
|
1495
1312
|
if (!CONFIG) {
|
|
@@ -1499,59 +1316,31 @@ sap.ui.define([], function () { 'use strict';
|
|
|
1499
1316
|
const lcName = transformCaseFunc(attr);
|
|
1500
1317
|
return _isValidAttribute(lcTag, lcName, value);
|
|
1501
1318
|
};
|
|
1502
|
-
|
|
1503
|
-
/**
|
|
1504
|
-
* AddHook
|
|
1505
|
-
* Public method to add DOMPurify hooks
|
|
1506
|
-
*
|
|
1507
|
-
* @param {String} entryPoint entry point for the hook to add
|
|
1508
|
-
* @param {Function} hookFunction function to execute
|
|
1509
|
-
*/
|
|
1510
1319
|
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
|
1511
1320
|
if (typeof hookFunction !== 'function') {
|
|
1512
1321
|
return;
|
|
1513
1322
|
}
|
|
1514
|
-
hooks[entryPoint] = hooks[entryPoint] || [];
|
|
1515
1323
|
arrayPush(hooks[entryPoint], hookFunction);
|
|
1516
1324
|
};
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
* (pops it from the stack of hooks if more are present)
|
|
1522
|
-
*
|
|
1523
|
-
* @param {String} entryPoint entry point for the hook to remove
|
|
1524
|
-
* @return {Function} removed(popped) hook
|
|
1525
|
-
*/
|
|
1526
|
-
DOMPurify.removeHook = function (entryPoint) {
|
|
1527
|
-
if (hooks[entryPoint]) {
|
|
1528
|
-
return arrayPop(hooks[entryPoint]);
|
|
1325
|
+
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
1326
|
+
if (hookFunction !== undefined) {
|
|
1327
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
1328
|
+
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
1529
1329
|
}
|
|
1330
|
+
return arrayPop(hooks[entryPoint]);
|
|
1530
1331
|
};
|
|
1531
|
-
|
|
1532
|
-
/**
|
|
1533
|
-
* RemoveHooks
|
|
1534
|
-
* Public method to remove all DOMPurify hooks at a given entryPoint
|
|
1535
|
-
*
|
|
1536
|
-
* @param {String} entryPoint entry point for the hooks to remove
|
|
1537
|
-
*/
|
|
1538
1332
|
DOMPurify.removeHooks = function (entryPoint) {
|
|
1539
|
-
|
|
1540
|
-
hooks[entryPoint] = [];
|
|
1541
|
-
}
|
|
1333
|
+
hooks[entryPoint] = [];
|
|
1542
1334
|
};
|
|
1543
|
-
|
|
1544
|
-
/**
|
|
1545
|
-
* RemoveAllHooks
|
|
1546
|
-
* Public method to remove all DOMPurify hooks
|
|
1547
|
-
*/
|
|
1548
1335
|
DOMPurify.removeAllHooks = function () {
|
|
1549
|
-
hooks =
|
|
1336
|
+
hooks = _createHooksMap();
|
|
1550
1337
|
};
|
|
1551
1338
|
return DOMPurify;
|
|
1552
1339
|
}
|
|
1553
1340
|
var purify = createDOMPurify();
|
|
1554
1341
|
|
|
1555
1342
|
return purify;
|
|
1556
|
-
|
|
1557
|
-
});
|
|
1343
|
+
// #### BEGIN: MODIFIED BY SAP
|
|
1344
|
+
});
|
|
1345
|
+
// #### END: MODIFIED BY SAP
|
|
1346
|
+
//# sourceMappingURL=purify.js.map
|