Skip to content

Read the rename rule from the parser function's own arguments - #115

Merged
alistair3149 merged 2 commits into
masterfrom
read-rename-on-server
Oct 8, 2026
Merged

alistair3149 merged 2 commits into
masterfrom
read-rename-on-server

Conversation

@alistair3149

@alistair3149 alistair3149 commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

{{#batchupload:Pics|rename = /^IMG_/-->Trip-}} now sets the rename
rule. +rename keeps working, but is deprecated. The rule is taken from
the parser function's arguments rather than cut out of the file page
text in the browser, which is what needed the +.

rename= is no longer passed to the template: {{#batchupload:T|rename=x}}
used to give template T a parameter rename, and now sets the rule.

A rule that is not a pattern between delimiters, --> and a replacement
now shows a warning on the upload area, which then starts full, instead
of being left in every file page's text. A rule inside <nowiki> can
contain |. A page still served from the parser cache renames nothing,
and shows the +rename warning, until it is parsed again.
Special:BatchUpload is unaffected.

The README's renaming section is rewritten around a table of examples and a table of the
parameter's parts.

AI-authored — Claude Code, Opus 5.5; suggestion from @alistair3149, design settled over 2 rounds of questions, README rewrite asked for after; diff not yet human-reviewed; Vitest, PHPUnit, PHPCS and PHPStan run locally, checked in Chrome (Vector 2022, also uselang=x-xss), CI green (22 checks).

alistair3149 and others added 2 commits October 8, 2026 12:40
`{{#batchupload:Pics|rename = /^IMG_/-->Trip-}}` now sets the rename
rule. `+rename` keeps working, but is deprecated. The rule is taken from
the parser function's arguments rather than cut out of the file page
text in the browser, which is what needed the `+`.

`rename=` is no longer passed to the template: `{{#batchupload:T|rename=x}}`
used to give template T a parameter `rename`, and now sets the rule.

A rule that is not a pattern between delimiters, `-->` and a replacement
now shows a warning on the upload area, which then starts full, instead
of being left in every file page's text. A rule inside `<nowiki>` can
contain `|`. A page still served from the parser cache renames nothing,
and shows the `+rename` warning, until it is parsed again.
Special:BatchUpload is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It leads with a table of Find and Replace with settings and what each
makes of one file name, and gives the rename parameter as a table of
its parts. It now also says that a page rule without g replaces only
the first match, that spaces after --> are kept, and that the uploader
can still change the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alistair3149
alistair3149 force-pushed the read-rename-on-server branch from d3ccc46 to f502862 Compare October 8, 2026 16:40
@alistair3149
alistair3149 merged commit 60385d8 into master Oct 8, 2026
22 checks passed
@alistair3149
alistair3149 deleted the read-rename-on-server branch October 8, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant