-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPD-19992 Validate id and name fields according to spec
- Loading branch information
1 parent
38f8da2
commit f10d351
Showing
17 changed files
with
73 additions
and
16 deletions.
There are no files selected for viewing
Submodule ckeditor-dev
updated
from d529d1 to 02cad0
2 changes: 1 addition & 1 deletion
2
patches/0001-LPS-89596-Cannot-Drag-Image-from-top-content-line-in.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0002-LPS-95472-Tabs-in-popups-not-appears-correctly-in-ma.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0004-LPP-36989-Remove-obsolete-summary-field-from-table-e.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0005-LPS-112982-Add-additional-resource-URL-parameters.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0006-LPS-118624-Don-t-pass-languageId-to-css-files-reques.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0008-LPS-125559-Fix-width-for-the-following-fields-Cell-s.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0010-LPS-136119-Set-id-on-first-render-instead-of-changin.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0013-LPS-139565-When-upgrading-from-6.2-to-7.1-image-widt.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0014-LPS-137763-If-contentsElement-is-defined-use-it-as-a.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/0015-LPS-166086-Make-dialog-close-button-accessible-with-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
patches/0016-LPD-19992-Validate-id-and-name-fields-according-to-s.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
From 02cad04a4ec12037805dbfbda98707893ef6216f Mon Sep 17 00:00:00 2001 | ||
From: Antonio Ortega <60252917@liferay.com> | ||
Date: Fri, 15 Mar 2024 11:36:44 +0100 | ||
Subject: [PATCH] LPD-19992 Validate id and name fields according to spec | ||
|
||
--- | ||
plugins/link/dialogs/link.js | 30 +++++++++++++++++++++++++++++- | ||
1 file changed, 29 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/plugins/link/dialogs/link.js b/plugins/link/dialogs/link.js | ||
index 46e452e741..39932fd2d9 100755 | ||
--- a/plugins/link/dialogs/link.js | ||
+++ b/plugins/link/dialogs/link.js | ||
@@ -1010,7 +1010,18 @@ | ||
|
||
this.setupContent( data ); | ||
}, | ||
- onOk: function() { | ||
+ onOk: function(event) { | ||
+ var idValue = this.getValueOf('advanced', 'advId'); | ||
+ var nameValue = this.getValueOf('advanced', 'advName'); | ||
+ | ||
+ if ( | ||
+ !validateField('id', idValue) || | ||
+ !validateField('name', nameValue) | ||
+ ) { | ||
+ event.data.hide = false; | ||
+ return; | ||
+ } | ||
+ | ||
var data = {}; | ||
|
||
// Collect data from fields. | ||
@@ -1046,6 +1057,23 @@ | ||
}; | ||
} ); | ||
|
||
+ function validateField(fieldName, fieldValue) { | ||
+ var regEx = /^[A-Za-z]+[\w\-:.]*$/; | ||
+ | ||
+ if (fieldValue && !regEx.test(fieldValue)) { | ||
+ alert( | ||
+ Liferay.Util.sub( | ||
+ Liferay.Language.get('there-was-an-error-when-loading-the-x-field'), | ||
+ fieldName | ||
+ ) | ||
+ ); | ||
+ | ||
+ return false; | ||
+ } | ||
+ | ||
+ return true; | ||
+ } | ||
+ | ||
function validateTelNumber() { | ||
var dialog = this.getDialog(), | ||
editor = dialog._.editor, |