changeset 4263:61a2bedbae80

sanitize IndexInSeries (we've seen spaces there !)
author Alain Mazy <alain@mazy.be>
date Fri, 30 Oct 2020 10:35:49 +0100
parents 9a01e0f89b6d
children d31cba1e27ac
files OrthancServer/Sources/ServerIndex.cpp OrthancServer/Sources/SliceOrdering.cpp
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerIndex.cpp	Fri Oct 30 09:00:24 2020 +0100
+++ b/OrthancServer/Sources/ServerIndex.cpp	Fri Oct 30 10:35:49 2020 +0100
@@ -977,7 +977,7 @@
               !value->IsBinary())
           {
             SetInstanceMetadata(content, instanceMetadata, instanceId,
-                                MetadataType_Instance_IndexInSeries, value->GetContent());
+                                MetadataType_Instance_IndexInSeries, Toolbox::StripSpaces(value->GetContent()));
           }
         }
 
--- a/OrthancServer/Sources/SliceOrdering.cpp	Fri Oct 30 09:00:24 2020 +0100
+++ b/OrthancServer/Sources/SliceOrdering.cpp	Fri Oct 30 10:35:49 2020 +0100
@@ -210,7 +210,7 @@
       {
         if (index.LookupMetadata(s, instanceId, MetadataType_Instance_IndexInSeries))
         {
-          indexInSeries_ = boost::lexical_cast<size_t>(s);
+          indexInSeries_ = boost::lexical_cast<size_t>(Toolbox::StripSpaces(s));
           hasIndexInSeries_ = true;
         }
       }