Skip to content

Allow motion's %$ conversion specifier - #3273

Merged
MichaIng merged 4 commits into
devfrom
enh/conversion-specifier
Jun 6, 2026
Merged

MichaIng merged 4 commits into
devfrom
enh/conversion-specifier

Conversation

@MichaIng

@MichaIng MichaIng commented Feb 15, 2026 •

Copy link
Copy Markdown
Member

This commit was done with an anonymous account in context of a study. The actual author might want to open a PR with its true account for proper credits, after the study ended. However, I am opening this here to show that this issue has been addressed, so no one starts doubled work 😉.

My only concern was that it re-introduced this RCE vulnerability: GHSA-j945-qm58-4gjx
However, the %$ seems to be replaced by motion before it is piped through the shell, so %$VARIALE and %$(command) are expanded to Camera1VARIABLE and Camera1(command) respectively, no variable or command substitution hence happens.

@MichaIng MichaIng added this to the v0.43.2 milestone Feb 15, 2026
@MichaIng
MichaIng marked this pull request as draft February 15, 2026 23:10
@MichaIng

Copy link
Copy Markdown
Member Author

@copilot
A translated string is expanded a way here, which does not require human re-translation. Please replace the respective origin string in the backend's .po files, and add the %$ to the translations as well. So msgmerge (and Weblate) won't treat this as new string, but keep the old translation just with %$ added.

Copilot AI commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

@MichaIng I've opened a new pull request, #3274, to work on those changes. Once the pull request is ready, I'll request review from you.

@MichaIng

MichaIng commented Feb 15, 2026 •

Copy link
Copy Markdown
Member Author

Great #3274 is ready to be merged into whichever PR adds this change. That way we avoid any additional translation needs. A blueprint for whenever we change source strings in a sufficiently trivial way, or in a way which does not render the translations entirely wrong. If some native speaker shall better have a look, we can let Copilot add the fuzzy tag, maybe even another custom tag: so it appears as unfinished in Weblate, but without the existing translation lost, and optionally with some custom explanation.

strawberry-poodle and others added 2 commits March 4, 2026 23:51
@MichaIng
MichaIng force-pushed the enh/conversion-specifier branch from 16291f9 to 98f7513 Compare March 4, 2026 22:54
@MichaIng
MichaIng marked this pull request as ready for review June 6, 2026 21:39
MichaIng and others added 2 commits June 6, 2026 23:39
…pecifier (#3274)

Signed-off-by: MichaIng <micha@dietpi.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@MichaIng

MichaIng commented Jun 6, 2026

Copy link
Copy Markdown
Member Author

I'll merge this now. I asked study orga to forward the info to the participants, but people are busy, and so far no one reacted. The changes are rather small, and we can craft a branch with the state from before this commit, to allow the true author to reapply it formally for the commit history, if needed. But I want to get these cleared now for 0.44.0 release.

@MichaIng
MichaIng merged commit a100167 into dev Jun 6, 2026
20 checks passed
@MichaIng
MichaIng deleted the enh/conversion-specifier branch June 6, 2026 22:13
This was referenced Jun 17, 2026
MichaIng pushed a commit that referenced this pull request Jun 29, 2026
…3377)

The image/movie file-name validator rejected the %I (12-hour hour),
%p (AM/PM) and %l (space-padded 12-hour hour) conversion specifiers, so
valid Motion file-name patterns such as "%Y-%m-%d/%I-%M-%S-%p" were
refused in the UI with "Make sure all the configuration options are
valid!", even though Motion saves the files correctly when the pattern
is set directly in the config.

Add I, p and l to filenameValidRegExp in both config.py and
static/js/main.js (kept in sync per the existing requirement) and list
the new specifiers in the validation failure message.

Fixes #2070

* Update translation catalogs for the new file-name specifiers

Insert %I %p %l into the filenameFailMessage specifier list across all
motioneye.po catalogs (both the msgid and the translated msgstr where one
exists) and motioneye.pot, so translators do not need to re-translate the
whole string when only literal specifiers are added. Mirrors #3273.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Image filename and movie filename fields don't allow the use of %$ conversion specifier

3 participants