Restrict name part of ISDCF name more (#2920).
authorCarl Hetherington <cth@carlh.net>
Mon, 30 Dec 2024 22:38:53 +0000 (23:38 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 1 Jan 2025 01:08:06 +0000 (02:08 +0100)
This disallows + and . from the name part of an ISDCF name.
I'm not 100% convinced about +, but . seems reasonable.

This also fixes the case where you do "copy as name" with
a name that should be transliterated, and the non-transliterated
characters re-appear.

src/lib/film.cc

index 1ac519011ac970635232065b8b508bedce48c838..ebbdfe013edc545ff02efb079a92e26e4799c5ba 100644 (file)
@@ -920,7 +920,7 @@ Film::isdcf_name (bool if_created_now) const
 
        fixed_name = fixed_name.substr(0, Config::instance()->isdcf_name_part_length());
 
-       isdcf_name += fixed_name;
+       isdcf_name += careful_string_filter(fixed_name, L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-");
 
        if (dcp_content_type()) {
                isdcf_name += "_" + dcp_content_type()->isdcf_name();