devexpress-richedit 24.1.6-build-24246-0102 → 24.1.7-build-24274-0102

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.d.ts)
3
- * Version: 24.1.6
3
+ * Version: 24.1.7
4
4
  * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs
6
6
  */
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.js)
3
- * Version: 24.1.6
3
+ * Version: 24.1.7
4
4
  * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs
6
6
  */
@@ -53,8 +53,8 @@ export class ClientRichEdit {
53
53
  this.rawDataSource = settings.rawDataSource;
54
54
  this.contextMenuSettings = settings.contextMenuSettings;
55
55
  this.fullScreenHelper = new FullScreenHelper(element);
56
- if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWExcHBaR1pSWjA1WGEyVkxaVmx6U2tJNFdHcFhaeUlLZlE9PS5mL01XY3Z5bDUyTFJMRWlMaEVyYnF1eW5yQ3FEQjdvZ0U1QVgxcGdpMXduSW9sT1MySFluNjBWeDBTb0VJVVpEUGhIRlBSQkdpSzg2cFA1K0xjMG56dUd6RFpEZkVUUS9CeklldjJoNTYzdWc2SzlKMCswMER0eTlvVW1GU2xvRTl6WTdQZz09In0=")
57
- config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWExcHBaR1pSWjA1WGEyVkxaVmx6U2tJNFdHcFhaeUlLZlE9PS5mL01XY3Z5bDUyTFJMRWlMaEVyYnF1eW5yQ3FEQjdvZ0U1QVgxcGdpMXduSW9sT1MySFluNjBWeDBTb0VJVVpEUGhIRlBSQkdpSzg2cFA1K0xjMG56dUd6RFpEZkVUUS9CeklldjJoNTYzdWc2SzlKMCswMER0eTlvVW1GU2xvRTl6WTdQZz09In0=")));
56
+ if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWNIQktkR3hUTlRaeU1HRjZNV3R4VldwWFNuTXRaeUlLZlE9PS5GSzV0WCtSUkt0akY2Q2NwaExOa0R2V0RCTHVkb0ZrdTN3LzJEMGMxRVlWMXp4KzJEYURkYnA0MGtPbXpKTnBRMXB0TUpiT1NTUm1JVmJaSU5VejRINDE3ejZMTDF4cDRZdWpyL2hQU3RiZlNodkNJMGFmemN4TzhXL1ZaVUJUR2gyZUh6UT09In0=")
57
+ config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWNIQktkR3hUTlRaeU1HRjZNV3R4VldwWFNuTXRaeUlLZlE9PS5GSzV0WCtSUkt0akY2Q2NwaExOa0R2V0RCTHVkb0ZrdTN3LzJEMGMxRVlWMXp4KzJEYURkYnA0MGtPbXpKTnBRMXB0TUpiT1NTUm1JVmJaSU5VejRINDE3ejZMTDF4cDRZdWpyL2hQU3RiZlNodkNJMGFmemN4TzhXL1ZaVUJUR2gyZUh6UT09In0=")));
58
58
  this.prepareElement(element, settings);
59
59
  this.initDefaultFontsAndStyles();
60
60
  this.initBars(settings.ribbon, settings.fonts);
@@ -4,6 +4,7 @@ import { ReadOnlyMode } from '../../interfaces/i-rich-edit-core';
4
4
  import { RichEditClientCommand } from '../client-command';
5
5
  import { CommandSimpleOptions } from '../command-base';
6
6
  import { HyperlinkCommandBase } from './hyperlink-command-base';
7
+ import { UrlUtils } from '../../../common/utils/utils';
7
8
  export class OpenHyperlinkCommand extends HyperlinkCommandBase {
8
9
  executeCore(state, options) {
9
10
  let field;
@@ -27,8 +28,10 @@ export class OpenHyperlinkCommand extends HyperlinkCommandBase {
27
28
  if (hyperlinkInfo.anchor)
28
29
  this.control.commandManager.getCommand(RichEditClientCommand.GoToBookmark)
29
30
  .execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, hyperlinkInfo.anchor));
30
- else if (!(Url.containsClientScript(hyperlinkInfo.uri) || /^\s*data\s*\:\s*/gi.test(hyperlinkInfo.uri)))
31
- Url.navigate(hyperlinkInfo.uri, "_blank");
31
+ else {
32
+ const url = UrlUtils.isValid(hyperlinkInfo.uri) ? hyperlinkInfo.uri : UrlUtils.EmptyPage;
33
+ Url.navigate(url, "_blank");
34
+ }
32
35
  return true;
33
36
  }
34
37
  isEnabledInReadOnlyMode() {
@@ -27,9 +27,8 @@ export class FieldsSettings {
27
27
  this.openHyperlinkOnClick = obj.openHyperlinkOnClick;
28
28
  if (isDefined(obj.keepHyperlinkResultForInvalidReference))
29
29
  this.keepHyperlinkResultForInvalidReference = obj.keepHyperlinkResultForInvalidReference;
30
- if (isDefined(obj.createHyperlinkTooltip) && obj.createHyperlinkTooltip !== '') {
30
+ if (isDefined(obj.createHyperlinkTooltip) && obj.createHyperlinkTooltip !== '')
31
31
  this.createHyperlinkTooltip = convertToFunction(obj.createHyperlinkTooltip);
32
- }
33
32
  }
34
33
  clone() {
35
34
  const result = new FieldsSettings();
@@ -11,3 +11,7 @@ export declare function searchTreeItem<T extends {
11
11
  }>(items: T[], comparer: (item: T) => boolean): SearchTreeItemResult<T> | null;
12
12
  export declare function convertToFunction(func: any): any | null;
13
13
  export declare function splitByLines(text: string): string[];
14
+ export declare class UrlUtils {
15
+ static EmptyPage: string;
16
+ static isValid(url: string): boolean;
17
+ }
@@ -56,3 +56,20 @@ export function convertToFunction(func) {
56
56
  export function splitByLines(text) {
57
57
  return text ? text.split(/\r\n|\r|\n/) : [''];
58
58
  }
59
+ const disallowedProtocols = [
60
+ 'data',
61
+ 'javascript'
62
+ ];
63
+ export class UrlUtils {
64
+ static isValid(url) {
65
+ const currentLocation = window.location.href;
66
+ try {
67
+ const resultUrl = new URL(url, currentLocation);
68
+ const protocol = resultUrl.protocol.slice(0, -1);
69
+ return !disallowedProtocols.includes(protocol);
70
+ }
71
+ catch (_a) { }
72
+ return false;
73
+ }
74
+ }
75
+ UrlUtils.EmptyPage = "about:blank";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.1.6-build-24246-0102",
3
+ "version": "24.1.7-build-24274-0102",
4
4
  "homepage": "https://www.devexpress.com/",
5
5
  "bugs": "https://www.devexpress.com/support/",
6
6
  "author": "Developer Express Inc.",
@@ -14,8 +14,8 @@
14
14
  "build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
15
15
  },
16
16
  "peerDependencies": {
17
- "devextreme": "24.1.6-build-24244-1936",
18
- "devextreme-dist": "24.1.6-build-24244-1936"
17
+ "devextreme": "24.1.7-build-24272-1937",
18
+ "devextreme-dist": "24.1.7-build-24272-1937"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",