changeset 6041:cad933339ead

OE: Allow '-' and '_' in labels.
author Alain Mazy <am@orthanc.team>
date Fri, 14 Mar 2025 15:21:17 +0100 (2 months ago)
parents cba3e8ca3a87
children 1ee8049e8d00
files NEWS OrthancServer/OrthancExplorer/explorer.js
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Mar 11 10:46:15 2025 +0100
+++ b/NEWS	Fri Mar 14 15:21:17 2025 +0100
@@ -27,7 +27,8 @@
   (Deflated Explicit VR Little Endian) in static builds
 * Housekeeper plugin:
   - When encountering an error, the housekeeper now skips the resource and continues processing.
-
+* Orthanc Explorer:
+  - Allow '-' and '_' in labels.
 
 
 Version 1.12.6 (2025-01-22)
--- a/OrthancServer/OrthancExplorer/explorer.js	Tue Mar 11 10:46:15 2025 +0100
+++ b/OrthancServer/OrthancExplorer/explorer.js	Fri Mar 14 15:21:17 2025 +0100
@@ -71,6 +71,11 @@
   return s.match(/^[0-9a-zA-Z]+$/);
 }
 
+function IsValidLabelName(s)
+{
+  return s.match(/^[0-9a-zA-Z\-_]+$/);
+}
+
 
 function DeepCopy(obj)
 {
@@ -780,7 +785,7 @@
             click: function () {
               var label = $.mobile.sdLastInput;
               if (label.length > 0) {
-                if (IsAlphanumeric(label)) {
+                if (IsValidLabelName(label)) {
                   $.ajax({
                     url: '../' + resourceLevel + '/' + resourceId + '/labels/' + label,
                     dataType: 'json',