aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukeflo2025-07-06 12:36:53 +0200
committerlukeflo2025-07-06 12:36:53 +0200
commit785c832d6a797103cf872b5ea6562e8dc59f24be (patch)
tree34d75afeb34f8224f268b516736bbbdba1a5e814
parente2b4e12cf1ce15a26172ac8f2166c5e02ca89351 (diff)
downloadbibiman-785c832d6a797103cf872b5ea6562e8dc59f24be.tar.gz
bibiman-785c832d6a797103cf872b5ea6562e8dc59f24be.zip
add forbidden chars to README
-rw-r--r--README.md6
-rw-r--r--src/app.rs5
2 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index 947c1d6..c00d288 100644
--- a/README.md
+++ b/README.md
@@ -440,6 +440,12 @@ directory is set to the value of the `note_path` variable. The extension can be
choosen from one of the file format extension set in the `note_extensions`
array.
+**Be aware**: The operation of creating new notes is not permitted if the
+citekey contains some special chars which could cause problems with Unixish
+shell commands and file operations. Currently the following chars are not
+allowed as part of the citekey: `/` | `|` | `#` | `*` | `\\` | `"` | `'` | `;` |
+`!`
+
The bibfile itself will *not be edited*. Therefore, you can't break anything in
your bibfile with this operation!
diff --git a/src/app.rs b/src/app.rs
index 708ec37..8b76f17 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -435,11 +435,16 @@ impl App {
.unwrap()]
.citekey
.clone();
+ // disallow chars which can cause other shell executions
if citekey.contains("/")
| citekey.contains("|")
| citekey.contains("#")
| citekey.contains("\\")
| citekey.contains("*")
+ | citekey.contains("\"")
+ | citekey.contains(";")
+ | citekey.contains("!")
+ | citekey.contains("\'")
{
self.bibiman.open_popup(
PopupKind::MessageError,