Commit Graph
12934 Commits
Author SHA1 Message Date
IgorA100 acebf40bfa Moved the "mb_ucfirst" function to \includes\functions.php (functions.php) 2026-05-07 12:35:17 +03:00
IgorA100 ddf29203e2 Moving the "mb_ucfirst" function from \skins\classic\includes\functions.php And adding a new "mb_lcfirst" function (functions.php) 2026-05-07 12:33:22 +03:00
IgorA100 5828107f23 Feat: Search for translations without regard to the case of the first letter (lang.php) 2026-05-07 12:25:24 +03:00
Isaac Connor 753a2923b1 Merge pull request #4798 from IgorA100/patch-84371
Fix: Download incomplete.mp4 event file (view_video.php)
2026-05-06 19:42:09 -04:00
Isaac ConnorandClaude Opus 4.7 c4073c964c feat: encoder parameter templates with editor + REST API closes #4778 closes #4802
Adds a curated, per-encoder parameter-template library to ZoneMinder:

- Monitor edit page: a new Template row above the EncoderParameters
  textarea offers per-encoder templates (Balanced / Archival / Low
  Power / Low CPU). Apply merges the template's params into the
  textarea, preserving user-only keys. Advisory lint flags option
  keys that aren't recognised for the selected encoder. Switching
  encoders offers a same-name template on the new encoder via a
  native confirm.

- Options page: a new Encoder Templates tab with full CRUD —
  list / edit / copy / delete — backed by a new CakePHP REST API
  at /api/encoder_templates.

- Storage: a new EncoderTemplates DB table seeded with 14 shipped
  defaults across libx264 / libx265 / h264_nvenc / hevc_nvenc /
  h264_vaapi / hevc_vaapi. The table is mutable; ZM upgrades do not
  re-seed user-edited rows.

- valid_keys (the lint allow-list) stays in PHP code as ffmpeg
  vocabulary, not user data.

- Default params explicitly include pix_fmt to avoid the yuvj420p
  HEVC HW-decode rejection issue we hit earlier.

No C++ change. The textarea content is parsed by the existing
av_dict_parse_string call in src/zm_videostore.cpp.

version.txt -> 1.39.6.

Specs: docs/superpowers/specs/2026-05-0{1,2}-*.md
Plans: docs/superpowers/plans/2026-05-0{1,2}-*.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 17:24:17 -04:00
IgorA100 cf23c07913 Update view_video.php 2026-05-06 17:44:58 +03:00
IgorA100 08f7afe6a4 More correct assignment of the $path_info value (view_video.php) 2026-05-06 17:33:04 +03:00
IgorA100 fc9a8c593e Update ru_ru.php 2026-05-06 12:38:14 +03:00
IgorA100 1ddc78734b Instead of "MP4" we will specify "video" (event.php) 2026-05-06 12:29:58 +03:00
IgorA100andCopilot Autofix powered by AI 3a2f49a6e6 Potential fix for pull request finding
OK, let's simplify this.
Let's hope that either there won't be any national characters in the file name, or that basename() will handle them correctly.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-06 12:22:29 +03:00
Isaac Connor f223c9e770 Merge pull request #4773 from IgorA100/patch-974485
Feat: Merge an array from a custom language file and en_gb.php
2026-05-05 21:34:44 -04:00
Isaac ConnorandClaude Opus 4.7 2630d55ffb feat: add Report::canEdit() and CreatedBy column
Add a CreatedBy column to the Reports table and a canEdit() method on
the Report class so $report->canEdit() (already called from
web/ajax/reports.php) resolves to a real check. canEdit() permits the
report owner (CreatedBy == user) or any user/role with System=Edit.
Wire actions/report.php to stamp CreatedBy on first save and refuse
save/delete on existing reports the current user cannot edit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 20:24:15 -04:00
Isaac Connor aa59b9aa7e Merge pull request #4796 from IgorA100/patch-409967
Analyzing "space" and "," key presses for positioning in the tag input field on Event page
2026-05-05 18:58:24 -04:00
Isaac Connor a10ad1eb5f Merge pull request #4795 from ZoneMinder/copilot/fix-auth-hash-ips-issue
fix: AUTH_HASH_IPS auth failure when behind reverse proxy
2026-05-05 18:57:39 -04:00
Isaac Connor 936e377fa7 Merge pull request #4791 from IgorA100/patch-452396
Prevent the scrollbar from appearing when displaying table column visibility settings (options.css)
2026-05-05 18:43:55 -04:00
IgorA100 ab09205cbd Avoid PHP Notice (view_video.php) 2026-05-05 19:08:56 +03:00
IgorA100 6ce9171b38 Fix: Pop-up file name on download button (event.php) 2026-05-05 17:36:44 +03:00
IgorA100 5589476cba Fix: Loading incomplete.mp4 event file (view_video.php)
Issue closure: #4774
2026-05-05 17:26:08 +03:00
IgorA100 bcdaae1d4a Fix: Display snapshot for incomplete event file (Update image.php) 2026-05-05 15:54:09 +03:00
IgorA100 b7a9026855 Analyzing "space" and "," key presses for positioning in the tag input field (event.js)
Supplement to #4783
2026-05-04 20:18:28 +03:00
copilot-swe-agent[bot]andconnortechnology 5b51d086e1 fix: use HTTP_X_FORWARDED_FOR in auth hash validation to fix AUTH_HASH_IPS with reverse proxy
When AUTH_HASH_IPS is enabled and ZoneMinder is behind a reverse proxy
(e.g. Nginx in front of Apache), the hash is generated using
HTTP_X_FORWARDED_FOR (the real client IP) but was validated using only
REMOTE_ADDR (the proxy's IP), causing all authentication to fail.

Fix by consistently using HTTP_X_FORWARDED_FOR (first IP only, to guard
against spoofed multi-value headers) with REMOTE_ADDR as fallback in
all three places:
- web/includes/session.php: where remoteAddr is stored for hash generation
- web/includes/auth.php: getAuthUser() validation (PHP, also used by zms CGI)
- src/zm_user.cpp: zmLoadAuthUser() validation (C++ zms binary)

refs #4758

Agent-Logs-Url: https://github.com/ZoneMinder/zoneminder/sessions/959dfe9d-edea-4de5-a3a0-f90b758e5628

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
2026-05-04 14:53:38 +00:00
Isaac Connor 7d19da131e Merge pull request #4781 from IgorA100/patch-873418
Fix: .tags-container on Event page if screen is narrow and there are many tags
2026-05-03 22:14:56 -04:00
IgorA100 2264741fe1 Prevent the scrollbar from appearing when displaying table column visibility settings (options.css)
For example, on the Servers page when there are only a few servers in the table.
2026-05-04 01:19:00 +03:00
IgorA100 3166cb58c4 Merge branch 'master' into patch-974485 2026-05-03 23:59:59 +03:00
IgorA100 0cf64c9ae4 Added $CLANG (lang.php) 2026-05-03 23:52:58 +03:00
IgorA100andCopilot Autofix powered by AI a18f142318 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-03 23:43:36 +03:00
Isaac Connor 60b6b37c60 Revert "fix: replace ZM_COLOUR system with AVPixelFormat for format dispatch" 2026-05-02 18:26:48 -04:00
Isaac Connor 4701ff2650 Merge pull request #4780 from IgorA100/patch-162247
Fix: ESLint (audioMotionAnalyzer.js)
2026-05-02 18:25:01 -04:00
Isaac Connor 81519fb2f1 Merge pull request #4742 from ZoneMinder/fix/deprecate-zm-colour-use-avpixelformat
fix: replace ZM_COLOUR system with AVPixelFormat for format dispatch
2026-05-02 18:24:37 -04:00
Isaac ConnorandClaude Opus 4.7 11544d86e3 fix: PR #4742 round 2 review feedback
Eight Copilot comments from the second review pass:

1. monitor.php (#3): "Deprecated - will be auto-detected..." note next
   to TargetColorspace bypassed translate(). Added DeprecatedColoursSetting
   key to en_gb and routed the deprecation note through translate() so it
   localises with the rest of the form.

2. tests/zm_pixformat.cpp (#4): zm_colours_from_pixformat / round-trip
   tests didn't cover the new YUV422P/YUVJ422P entries (added by
   02e6be6b4). Added explicit assertions in both test cases — bumps
   pixformat coverage from 105 to 115 assertions.

3. zm_image.cpp WriteBuffer (#5): linesize and size were derived from
   p_width * p_colours, which undercounts planar YUV* (where p_colours=1
   via the GRAY8 alias collision but actual buffer needs ~1.5x/2x for
   chroma). Use av_image_get_buffer_size and av_image_get_linesize for
   the AVPixelFormat instead, with bail-out on either failing.

4. zm_image.cpp AssignDirect (#6, #7): av_image_get_buffer_size returns
   int and can be negative; assigning that into unsigned size/allocation
   wrapped to a huge value. Check the return first, treat negative as the
   same "unsupported format" failure as zm_colours_from_pixformat
   returning false, and reset size/allocation/linesize/pixels to 0
   (alongside imagePixFormat=NONE/colours=0/subpixelorder=0) so the
   Image is left in a single coherent invalid state instead of partially
   stale.

5. zm_image.cpp Assign (#8): av_get_pix_fmt_name(format) can return
   nullptr (e.g. AV_PIX_FMT_NONE / unknown); passing that into
   Debug(..., "%s", ...) would segfault. Capture once with a fallback
   string before logging.

6. zm_monitor.cpp Capture path (#9): same nullptr issue with two Debug
   calls — capture native_fmt_name once with fallback.

7. zm_monitor.cpp can_passthrough comment (#10): comment claimed
   YUVJ422P would be converted to YUV420P because Image drops chroma,
   but can_passthrough now allows YUV422P/YUVJ422P passthrough since
   02e6be6b4 added 4:2:2 support. Updated the comment to describe the
   current behavior (full 4:2:0 + 4:2:2 planar passthrough plus GRAY8
   and RGB24/32) so the code and the rationale agree.

Tests: 76 cases, 788 assertions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:59:51 -04:00
Isaac Connor f2fc00bce2 Merge pull request #4782 from IgorA100/patch-73438
Chore: Minor improvements to Files page
2026-05-02 14:55:56 -04:00
IgorA100 ab4050cbfb Tag Management Optimization (event.js)
After entering a tag name and pressing "Enter," focus will be moved to "#tagInput." This allows you to enter multiple tags without manually positioning the cursor.
When the cursor is in "#tagInput" and the "Ctrl" + "Left" or "Ctrl" + "Right" key combination is pressed, a new tag (or an existing one attached to an event) entered in "#tagInput" will be added and the previous or next event will be navigated to. This eliminates unnecessary mouse movements for pressing the "tagPrevBtn" and "tagNextBtn" buttons.
2026-05-02 16:59:49 +03:00
IgorA100 8552404159 Update files.php 2026-05-02 15:58:48 +03:00
IgorA100 a14f59e34c Added table styles (files.css) 2026-05-02 15:53:22 +03:00
IgorA100 0adda15ffd Fix: .tags-container on Event page if screen is narrow and there are many tags (skin.css) 2026-05-02 13:37:03 +03:00
IgorA100 678af72aff Fix: ESLint (audioMotionAnalyzer.js) 2026-05-02 13:16:13 +03:00
Isaac Connor c58a3ccdda Merge pull request #4758 from IgorA100/patch-718309
When using ONVIF, the console page should not display simply "Use ONVIF Events", but should also indicate which event the trigger is configured for.
2026-05-01 18:24:01 -04:00
Isaac Connor b267c18cf6 Merge pull request #4762 from IgorA100/patch-447707
Now we will pause audioMotion in MonitorStream.js
2026-05-01 18:19:36 -04:00
Isaac Connor 810fc0944c Merge pull request #4753 from IgorA100/patch-546864
Provide the user with up-to-date information about the supported version of audioMotionAnalyzer
2026-05-01 18:16:55 -04:00
Isaac Connor 1cfe6eeb07 Merge pull request #4760 from IgorA100/patch-690135
FIX: Avoid reinitializing audioMotion if the previous one has not yet finished.
2026-05-01 18:16:15 -04:00
Isaac Connor 4cb5fe5d8f Merge pull request #4768 from IgorA100/patch-684933
Chore: Minor improvements to statistics display on the Event page
2026-05-01 18:15:23 -04:00
Isaac Connor df381f7837 Merge pull request #4752 from IgorA100/patch-974193
Chore: UI optimization on User page
2026-05-01 18:15:13 -04:00
Isaac Connor c99bf88078 Merge pull request #4769 from IgorA100/patch-826994
Change from translate('What display') to translate('Show') on Event page
2026-05-01 18:14:15 -04:00
Isaac Connor 1ad5c55fe2 Merge pull request #4770 from IgorA100/patch-976642
Chore: Minor style optimization for ".tags-container" on the Event page
2026-05-01 18:13:55 -04:00
Isaac Connor 0ce6155ef2 Merge pull request #4771 from IgorA100/patch-142774
Correction of the Russian translation (ru_ru.php)
2026-05-01 18:13:18 -04:00
Isaac Connor cbf43e0472 Merge pull request #4764 from IgorA100/patch-923399
Prevent an error from being generated when processing the file "index.m3u8" (image.php)
2026-05-01 18:08:55 -04:00
Isaac Connor 68b05f3dba Merge pull request #4759 from IgorA100/patch-400417
Apply "chosen" to the Event page
2026-05-01 18:08:24 -04:00
Isaac Connor 45dd04aae4 Merge pull request #4749 from IgorA100/patch-590744
Display a modal window confirming the deletion of a user on Options page -> users
2026-05-01 18:07:02 -04:00
Isaac ConnorandClaude Opus 4.7 9233d5cc2b fix: parse HTTP Range header correctly in output_file() fixes #4777
The previous implementation used `str_replace($range, '-', $range)` which
is a no-op (wrong arg order, return value discarded), then cast the raw
Range value (e.g. "12345-67890" or "-500") to int. The function then
ignored the requested END entirely and always streamed from the parsed
start to EOF.

For a suffix range like `Range: bytes=-500` -- which Chrome's media stack
sends to locate the moov atom in many HEVC mp4s -- (int)"-500" is -500,
producing Content-Length = filesize + 500. fseek with SEEK_SET fails for
negative offsets, so the body delivered was filesize bytes against an
inflated Content-Length, triggering ERR_CONTENT_LENGTH_MISMATCH in the
browser and blocking HEVC playback in the files view.

Parse `bytes=start-end`, `bytes=start-`, and `bytes=-suffix` per RFC 7233,
clamp the end to file size, return 416 for unsatisfiable ranges, set
Content-Length to the actual byte count served, and stop reading once
that many bytes have been emitted. Guard ob_flush() with ob_get_level()
so it does not warn when no buffer is active.

Verified on pseudo by loading an HEVC mp4 in Chrome -- the
ERR_CONTENT_LENGTH_MISMATCH is gone, the browser parses metadata
(duration, dimensions) and buffers playback data normally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:00:59 -04:00
IgorA100 868aaa7070 To avoid overriding the zmVlang() function (en_gb.php)
This file may be loaded alongside another language translation file.
2026-05-01 00:03:07 +03:00