Skip to content

Commit b9316a6

Browse files
authored
fix(cli): validate productName in config, closes #5233 (#5262)
1 parent ae65951 commit b9316a6

7 files changed

Lines changed: 574 additions & 125 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"cli.rs": "patch"
3+
"tauri-utils": "patch"
4+
---
5+
6+
Validate `pacakge > productName` in the tauri config and produce errors if it contains one of the following characters `/\:*?\"<>|`
7+

core/tauri-utils/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,7 @@ impl<'d> serde::Deserialize<'d> for PackageVersion {
25852585
pub struct PackageConfig {
25862586
/// App name.
25872587
#[serde(alias = "product-name")]
2588+
#[cfg_attr(feature = "schema", validate(regex(pattern = "^[^/\\:*?\"<>|]+$")))]
25882589
pub product_name: Option<String>,
25892590
/// App version. It is a semver version number or a path to a `package.json` file containing the `version` field.
25902591
#[serde(deserialize_with = "version_deserializer", default)]

0 commit comments

Comments
 (0)