-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: global-yaml-properties-plugin
Problems
== Inline Script Block
Line: 37
----
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
// Attach event listener to parent element
var formElement = document.querySelector('form[name="configs"]');
// If any "error" div elements are found, prevent form submission
formElement.addEventListener('submit', function(event) {
var errorDivs = formElement.querySelectorAll('div.error');
if (errorDivs.length > 0) {
event.preventDefault();
alert('Form validation failed. Please correct the errors and try again.');
}
});
// Process readonly logic for textareas with CodeMirror
formElement.addEventListener('change', function(e) {
if (e.target.name === 'enableReadOnly') {
var checkbox = e.target;
var closestBlock = checkbox.closest('.tbody.dropdownList-container');
var textarea = closestBlock.querySelector('textarea[name="yamlConfig"]');
if (textarea.hasAttribute('readonly')) {
textarea.removeAttribute('readonly');
} else {
textarea.setAttribute('readonly', 'readonly');
}
}
});
});
</script>
----
== Legacy checkUrl
Line: 21
----
checkUrl="'checkName?value='+escape(this.value)"
----
Solutions
https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
https://www.jenkins.io/doc/developer/security/csp/#legacy-javascript-checkurl-validation