Commit Graph

12295 Commits

Author SHA1 Message Date
Isaac Connor
4ebbc540ca Merge pull request #4601 from pliablepixels/fix-tag-filtering
fix: correct tag filter operator handling for No Tag and Any Tag
2026-02-07 15:38:11 -05:00
Pliable Pixels
79253dc374 fix: address review feedback for tag filter handling
- Add IS NOT operator check alongside != in PHP FilterTerm.php
  (was already handled in Perl but missing from PHP)
- Add defined() guard on $term->{val} in Perl Filter.pm to avoid
  uninitialized value warnings with malformed/legacy saved filters

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:11:13 -05:00
Pliable Pixels
1188635e9a fix: correct tag filter operator handling for "No Tag" and "Any Tag"
The filter system ignored the operator (= vs !=) when generating SQL
for the special tag values "No Tag" (0) and "Any Tag" (-1).

In PHP (FilterTerm.php), "Tag != Any Tag" produced EXISTS instead of
NOT EXISTS, returning events WITH tags instead of events WITHOUT tags.

In Perl (Filter.pm), != was not handled as a special case and fell
through to generic SQL (T.Id != -1), which excluded events with no
tags because LEFT JOIN produces NULL and NULL != -1 evaluates to
UNKNOWN in SQL. Additionally, T.Id was unconditionally prepended for
all tag values, producing invalid SQL (T.IdEXISTS) for the special
cases that use EXISTS/NOT EXISTS subqueries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:01:39 -05:00
Isaac Connor
208779ed60 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-02-06 13:23:56 -05:00
Isaac Connor
0bd4acbdf7 fix: prevent Chrome from offering to save monitor camera credentials
The monitor form has password fields for camera credentials (ONVIF,
RTSP) which triggered Chrome's "save password" prompt on every save
or navigation.

Convert "Save and Close" from native form submit to AJAX via
saveMonitorData() with redirect, matching how "Save" already works.
Clear password field values before any remaining native form
submissions (Type/Method changes) and on pagehide, since the values
are repopulated from the database on reload. Remove the ineffective
dummy hidden password field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 11:40:10 -05:00
Isaac Connor
54adbb57ff Merge pull request #4599 from IgorA100/patch-134551
Added the constant "PLACEHOLDER_IMAGE" which is equal to a transparent GIF of 1 pixel (skin.js)
2026-02-06 10:35:42 -05:00
IgorA100
b09dc9264d When downloading event files, create the "ZM_DIR_EXPORTS" directory if it does not exist (download.php) 2026-02-06 16:43:19 +03:00
IgorA100
0b1afa928c Added the constant "PLACEHOLDER_IMAGE" which is equal to a transparent GIF of 1 pixel (skin.js) 2026-02-06 14:54:51 +03:00
Isaac Connor
8f28cc4725 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-02-05 17:59:03 -05:00
Isaac Connor
9047fb691e Merge pull request #4595 from IgorA100/patch-326084
Fix: Optimization code for displaying monitor status in the "Show on hover" mode on the Montage page
2026-02-05 17:17:35 -05:00
Isaac Connor
5f2dc621bd fix: guard against undefined container in scaleToFit
- Check container.length instead of just container (empty jQuery objects are truthy)
- Guard against container[0] being undefined before accessing lastElementChild
- Add check for bottomEl.length before calling offset() on it

Fixes TypeError when scaleToFit is called with a selector that matches nothing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:54:54 -05:00
Isaac Connor
3f58bc762d fix: update auth_relay along with auth_hash in event.js
When auth_hash changes, auth_relay must also be updated to stay in sync.
The event.js getCmdResponse was only updating auth_hash, which could
cause requests to use stale auth_relay values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:50:05 -05:00
Isaac Connor
079b873380 fix: correct auth property name in getStatusCmdResponse
The PHP status.php returns 'auth' but getStatusCmdResponse was checking
for 'auth_hash'. This mismatch prevented auth hash updates from status
responses from ever being applied, causing invalid hash errors after
the auth expired.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:44:52 -05:00
Isaac Connor
60fbea3880 fix: security and code quality improvements in auth.php
- Fix SQL injection vulnerability in migrateHash() by using prepared statements
- Add null/empty check in password_type() to prevent array access error
- Remove dead code branch in generateAuthHash() (unreachable $_SESSION check)
- Fix PHP version in error message (5.3 -> 5.5 for password_hash)
- Prevent username enumeration by using consistent error messages
- Fix spacing inconsistency in substr() call
- Add TODO comment about MD5 hash weakness

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 15:10:55 -05:00
Isaac Connor
d64636cf7d fix: prevent stream commands from being sent after quit
Added started flag checks in streamCommand() and streamCmdQuery() to
prevent commands from being sent after the stream has been killed.
This fixes an issue where scale commands were being sent after quit
commands during page reload.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:59:16 -05:00
Isaac Connor
458be55418 style: use let/const instead of var in montage_common.js and export.js
- Change var to let/const for proper block scoping
- Use const for variables that are not reassigned

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:30:11 -05:00
Isaac Connor
81ceed9c40 fix: fix JS issues in skin.js
- Change var to let/const for proper block scoping in for loops and
  conditionals
- Fix variable shadowing (renamed inner 'el' to 'element')
- Remove erroneous semicolons after function declaration and else block
- Use const for variables that are not reassigned

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:49:25 -05:00
Isaac Connor
a814c8ef22 fix: fix typo and undeclared variables in zone.js
- Fix typo 'btn-primaryary' -> 'btn-primary' which prevented the
  class from being removed when toggling analyse mode
- Declare CheckMethod and el variables with let to avoid creating
  implicit globals

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:25:43 -05:00
Isaac Connor
72bd85c861 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-02-05 10:25:23 -05:00
Isaac Connor
4eeb0cc08a Merge pull request #4594 from IgorA100/patch-635393
Fix: Vertically center the ".btn-term-remove-all" button in the sidebar filter (sidebar.css)
2026-02-05 10:09:17 -05:00
Isaac Connor
5a706aa5de style: use let instead of var in for loops
Replace var with let in for loop declarations for proper block scoping.
Affects console.js, monitor.js, montage.js, montagereview.js, zone.js,
and zones.js.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:05:39 -05:00
Isaac Connor
ecc7eacc08 fix: use consistent parameter naming and remove debug logs in filter.js
- Change click_AutoEmail, click_automove, click_autocopy to use the
  'element' parameter instead of 'this' for consistency
- Remove debug console.log statements for availableTags, operator
  defaults, and term parsing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:30:41 -05:00
Isaac Connor
c4a90cea93 refactor: move escapeHTML to skin.js as shared utility
Move the escapeHTML function from filter.js to skin.js so it can be
reused across views. Also switch from textarea-based encoding to
explicit string replacement which is cleaner and doesn't require
maintaining a DOM element.

This also fixes the issue where 'escape' variable shadowed the
built-in JavaScript escape function.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:27:39 -05:00
Isaac Connor
1222fbca56 fix: correct malformed HTML option tags in filter.js
The bracket select options were missing the closing > in their
opening tags, causing invalid HTML to be generated.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:17:13 -05:00
Isaac Connor
591db357a8 Fix missing consts 2026-02-05 09:07:38 -05:00
IgorA100
4761f78242 Fix: Optimization code for displaying monitor status in the "Show on hover" mode on the Montage page (montage.js)
Also, I prevented the status display block from flickering when hovering over it.
2026-02-05 14:57:30 +03:00
IgorA100
aa2b6a197c Fix: Added padding to the right to prevent elements from overlapping the ".btn-term-remove-all" button (sidebar.css) 2026-02-05 12:59:35 +03:00
IgorA100
0c5d7e1e18 Fix: Vertically center the ".btn-term-remove-all" button in the sidebar filter (sidebar.css) 2026-02-05 12:43:31 +03:00
Isaac Connor
6b7c96aba1 Only show DHCP/dnsmasq and X10 options if they are enabled 2026-02-04 22:55:50 -05:00
Isaac Connor
e64eb7b8f8 Add hevc as a decoder 2026-02-04 22:55:50 -05:00
Isaac Connor
7592fd933c Fix command injection vulnerability in image.php (CVE-2025-65791)
Add input validation and shell argument escaping to prevent OS command
injection via the 'show' parameter in web/views/image.php. The parameter
is now validated against an allowlist and all values passed to exec()
are wrapped with escapeshellarg().

Also fix PHP operator precedence bug in shutdown.php where 'and' was
used instead of '&&', causing the 'when' parameter validation to not
work as intended.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:39:38 -05:00
Isaac Connor
446b1a563b Define players for montage 2026-02-03 12:17:52 -05:00
Isaac Connor
f17d68cb3d Log when ondata is not defined 2026-02-03 12:11:32 -05:00
copilot-swe-agent[bot]
3d8399bfab fix: Use numeric constant for CURLE_PEER_FAILED_VERIFICATION in PHP
The CURLE_PEER_FAILED_VERIFICATION constant may not be defined in all PHP curl versions. Use the numeric value (51) instead for better compatibility.

refs #TBD

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
2026-02-02 14:36:00 +00:00
copilot-swe-agent[bot]
bce080c735 feat: Enable SSL certificate verification with fallback for all components
Enable TLS peer certificate verification by default in all components that communicate over HTTPS. If SSL verification fails, log a warning and retry without verification to maintain backward compatibility with cameras using self-signed certificates.

Changes:
- C++ (zm_monitor_go2rtc.cpp): Enable SSL verification for all curl operations (3 locations)
- C++ (zm_monitor_rtsp2web.cpp): Enable SSL verification for all curl operations (3 locations)
- PHP (monitor_probe.php): Enable SSL verification with fallback logic
- Perl (Dahua.pm): Enable SSL verification with LWP::UserAgent
- Perl (TapoC520WS_ONVIF.pm): Enable SSL verification with retry logic in request methods

refs #TBD

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
2026-02-02 14:34:19 +00:00
Isaac Connor
100ffcfef7 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-02-01 13:02:27 -05:00
Isaac Connor
ac4585b6b4 fix: use monitor's StreamChannel setting for go2rtc stream selection
Two issues caused monitors to stream from wrong channel:

1. In setChannelStream(), the expression `StreamChannel && SecondPath`
   returned SecondPath (often empty) instead of StreamChannel. Now
   correctly uses the monitor's configured StreamChannel.

2. In MonitorStream.start(), default channel only checked for
   CameraDirectSecondary and defaulted everything else to Restream.
   Now respects the actual StreamChannel setting.

Also improved fallback when selected option is disabled to find first
enabled option rather than always defaulting to Restream.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:01:50 -05:00
Isaac Connor
f05370eb05 fix: add missing Path and Restream fields to monitorData in watch view
The manageChannelStream() function expected Path and Restream fields
in monitorData to enable/disable StreamChannel options, but these
fields were not being populated. This caused CameraDirectPrimary and
Restream options to always be disabled on the watch view.

Also updated SecondPath to use validJsStr() for proper escaping.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:26:43 -05:00
Isaac Connor
68add32f9c Merge pull request #4576 from Simpler1/patch-6
Fix(): Find server in database instead of defaulting to port 80
2026-02-01 11:27:50 -05:00
Simpler1
391e9d3097 Merge branch 'master' into patch-6 2026-01-31 21:19:30 -05:00
Simpler1
4355030e73 Update skin.js.php
Revert change to skin.js.php
2026-01-31 21:03:32 -05:00
Simpler1
e922b9e16d Update Server.php
Don't require a database entry for Server.
Use ZM_BASE_URL.
2026-01-31 21:01:00 -05:00
Isaac Connor
eae89025ee refactor: rename RTSP2WebStream to StreamChannel
Rename applies to Go2RTC, Janus, and RTSP2Web streaming options.
Update enum values from Primary/Secondary to Restream/CameraDirectPrimary/CameraDirectSecondary.

- Add db migration zm_update-1.37.79.sql to rename column and migrate data
- Update C++ enum StreamChannelOption and member stream_channel
- Update PHP getStreamChannelOptions() method
- Update all JavaScript references
- Auto-select CameraDirectPrimary when Restream option becomes disabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:37:08 -05:00
Isaac Connor
02685bff7e Pick up missed update for Restream and RTSP_User 2026-01-31 18:54:14 -05:00
Isaac Connor
d89f2e59db refactor: rename Janus_Use_RTSP_Restream to Restream
Rename Janus-specific restream fields to be more generic since they are
now used by Go2RTC and RTSP2Web as well:
- Janus_Use_RTSP_Restream → Restream
- Janus_RTSP_User → RTSP_User

Update visibility logic so the Restream checkbox appears when RTSPServer
is enabled AND any streaming service (Janus, Go2RTC, or RTSP2Web) is
selected, rather than only when Janus is enabled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:47:37 -05:00
IgorA100
3dee901585 Fix: Removed duplicates (watch.css) 2026-01-30 19:59:56 +03:00
Isaac Connor
cbbdeb2910 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-01-30 11:41:09 -05:00
Isaac Connor
b254ea60a8 Remove hard coded scale=32 for the stream image. 2026-01-30 11:40:58 -05:00
Isaac Connor
41d3a25964 Use a smarted calculation to determine an optimal streaming scale. 2026-01-30 11:40:33 -05:00
Isaac Connor
c59bc3678f Add hevc_vaapi as an encoder option 2026-01-30 08:33:49 -05:00