48393469730c8fb8759cc41d50c95c26380991be from master; block possibly bad characters...
authorCarl Hetherington <cth@carlh.net>
Mon, 25 May 2015 13:57:47 +0000 (14:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 25 May 2015 13:57:47 +0000 (14:57 +0100)
ChangeLog
TO_PORT
src/lib/film.cc

index 58f0d68d4fa86443855318358376fa0ff7e02594..64c253550e3cd8ef1ba7e9cb4f8e9bce855738e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2015-05-25  Carl Hetherington  <cth@carlh.net>
 
+       * Block all but alphanumeric characters with a few bits
+       of punctuation from DCP names.
+
+       * Improve view of jobs in various ways.
+
        * Increase the number of images that DCP-o-matic will
        keep around in memory before resorting to pushing them
        to disk.
diff --git a/TO_PORT b/TO_PORT
index b97043bb1fa9ac2b6f92fec4bbc34a740c711f30..146714d5e3e23a176a1942b69d1127cb57cc755b 100644 (file)
--- a/TO_PORT
+++ b/TO_PORT
@@ -1,6 +1,3 @@
-33a2bece96b7875134c99a2053a2fc59e828ae33
-b41b6528fbe0d270415a8500a612da19469e49e4
-c040b70eb777630ef0fdbb80cd419f6b3da4b46e
 ea2becf3a859bc38c783d15f165d71f2ccb8c1d6
 21cb435ed5eb250a7f94887ddd75f6b367ea231f
 Multi-stream audio stuff.
index 0af4c5611d8be2f4355a549b51451c87ae2d8eb3..e5c5d931265a41bf293d2eef940251d7c85811eb 100644 (file)
@@ -656,11 +656,26 @@ Film::isdcf_name (bool if_created_now) const
 string
 Film::dcp_name (bool if_created_now) const
 {
+       string unfiltered;
        if (use_isdcf_name()) {
-               return isdcf_name (if_created_now);
+               unfiltered = isdcf_name (if_created_now);
+       } else {
+               unfiltered = name ();
        }
 
-       return name();
+       /* Filter out `bad' characters which cause problems with some systems.
+          There's no apparent list of what really is allowed, so this is a guess.
+       */
+
+       string filtered;
+       string const allowed = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
+       for (size_t i = 0; i < unfiltered.size(); ++i) {
+               if (allowed.find (unfiltered[i]) != string::npos) {
+                       filtered += unfiltered[i];
+               }
+       }
+       
+       return filtered;
 }
 
 void