luci-base: fix feature detection patterns
authorJo-Philipp Wich <redacted>
Tue, 24 Mar 2026 19:50:05 +0000 (20:50 +0100)
committerJo-Philipp Wich <redacted>
Mon, 30 Mar 2026 13:08:45 +0000 (15:08 +0200)
commit0529dca7a263a9ce713dd043d87467d16544e204
tree6fce77d6ac3e4ac98009da2e4acd0d7c292af2fb
parenta4f0c52fbf5db5a9a51c81866d7f3ac688ec95f4
luci-base: fix feature detection patterns

Upstream ucode commit 8a8b4d1 ("types: fix regexp `/.../s` flag inversion")
changed the semantics of /.../s regexp patterns to match the ECMAScript
behavior, meaning `/s` enables single line matching and omitting it
performs line-wise matching. Besides changing the behavior of `.` to match
newlines, the `/s` flag also changes `^` and `$` to only match the begin
and end of the entire string input, respectively instead of matching the
start and end of lines.

This broke feature pattern matching in the luci rpcd plugin, causing LuCI
to incorrectly disable certain features.

This commit changes the affected places to read the command outputs
linewise and to perform the feature flag matching against each read line
individually, including an explicit terminating newline to make the
pattern match forward- and backward compatible with fixed and unfixed
ucode versions.

Fixes: https://github.com/jow-/ucode/issues/389
Signed-off-by: Jo-Philipp Wich <redacted>
modules/luci-base/root/usr/share/rpcd/ucode/luci
git clone https://git.99rst.org/PROJECT