Commit Graph
19 Commits
Author SHA1 Message Date
Nic Boet 35a8daf99e perf: emulate prepares for ZoneMinder's own queries on PHP 8.1+
dbConnect() turns emulated prepares off, so every query of the web UI, the
ajax calls and the includes the API runs (config, servers, users,
permissions) is a server-side prepare: prepare, execute and close, three
round trips to the database where one would do. From PHP 8.1, pdo_mysql
returns integers and floats as PHP ints and floats with emulated prepares
too, so values keep the types they have now. Emulate prepares there and keep
server-side prepares on older PHP, where every value would become a string.

Emulated prepares quote parameters bound as strings, which breaks LIMIT ?.
dbQuery() now binds integer values as integers (everything else as strings,
as execute() did), and the log and watch ajax calls cast their validated
offset and limit to int. With emulation, PDO would also run several
statements given in one string; MYSQL_ATTR_MULTI_STATEMENTS is turned off so
that is refused as before. CakePHP's own connection is not changed: it
already uses PDO's default, emulated prepares.

tests/php/test_database_emulated_prepares.php compares every column of every
table read through both kinds of prepare (types and values), checks
aggregates, LIMIT with positional and named integers, string and null
parameters, and that two statements in one string are refused.
2026-10-14 22:41:42 -05:00
IgorA100 a233fc1224 - Correct HLS playback on the Watch page
- When executing Event->Length() , get the duration of the recorded event file if the duration in the database table is 0
- If native HLS playback fails in Safari, we first try playing MP4, and only if MP4 playback fails do we switch to MJPEG playback
2026-05-31 16:25:51 +03:00
IgorA100andCopilot Autofix powered by AI 7a8db271bf Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-27 12:20:42 +03:00
IgorA100 51300dec48 Added the data-event-start attribute to the img on the Watch page (watch.php). 2026-05-26 20:21:16 +03:00
Isaac ConnorandClaude Opus 4.6 61b025b85f fix: calculate optimal thumbnail overlay scale from monitor dimensions
Add data-monitor-width and data-monitor-height attributes to thumbnail
img elements in console.php, events.php, watch.php, and monitor.php.
Use these to calculate the scale parameter as a ratio of overlay size to
monitor native resolution, clamped to 5-100%, instead of hardcoding
scale=75 (overlay) and scale=32 (fallback).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 12:16:56 -05:00
Ben DaileyandClaude Opus 4.5 8d655af63f feat: replace in-place thumbnail zoom with centered overlay popout
Thumbnail hover now creates a separate overlay element centered
on-screen instead of transforming the original thumbnail in place.
The overlay shows the cached still image as a background for instant
display, with the stream or video layered on top.

When an event has an mp4 file (DefaultVideo), the overlay uses a
<video> tag at 5x playback speed for smooth hardware-decoded
playback. Falls back to MJPEG <img> stream with scale=32 when
no mp4 is available. On mouseout the stream/video connection is
explicitly stopped before the overlay is removed.

Removes the old .zoom/.zoom-console CSS classes and the console
overflow workarounds that were needed for the in-place approach.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:12:25 -05:00
Simpler1 3d008263e4 fix(tags): Tags were not populated on watch view 2024-03-02 11:30:35 -05:00
Isaac Connor 1255ae4bc7 Change Tags to be concated and add GROUP BY to fix SQL. Populate event object with db row instead of reloading by Id. Remove datetime formatting as it is screwing up and formatting should happen in js 2024-01-24 13:00:31 -05:00
Isaac Connor f8c89a0405 Merge branch 'master' into tags 2023-09-14 16:42:06 -04:00
Isaac Connor de8f387207 Restrict mid to a cardinal value. Fixes GHSA-9cmr-7437-v9fj 2023-09-13 10:12:04 -04:00
Isaac Connor a194fe81d3 Only allow Events Columns for sort. Fixes GHSA-2qp3-fwpv-mc96. Fixes GHSA-9cmr-7437-v9fj 2023-09-11 11:29:54 -04:00
Simpler1 18d74ed7ac (feat): Tags
fix(tag): Create tags on mobile

chore(tags): Change TagName to Name

chore(tags): eslint

chore(tags): dbFetchAll to dbQuery for removetag

chore(events): eslint (attempt 2)

feat(tags): Better handling of keyboard

fix(tags): Enter key for creating new tag

fix(tags): Don't allow space as a tag name

feat(tags): Delete tag if last assignment removed

fix(tags): Increase height of dropdown

in progress

fix(Tags): Use T.Id on the events page dropdown

fix(Tags): Remove $availableTags from events.php

chore(sql): Formatting sql statements

feat(Tags): Working OR on filters and events pages

fix(filter): Populate availableTags

chore(Tags): code formatting

fix(tag): Add tag on create tag

Fix(tags): Remove tag from available if last

feat(tags): Add zm_update.sql

fix(chosen): Undo css width

fix(chosen): tags dropdown width

fix(tags): dropdown over timeline

fix(tags): Full width input

fix(events): Refresh table on page show

chore(filter): Clean up availableTags

chore(event): Clean up available & selected Tags

fix(event): Update available tags on remove

fix(event): Remove hack for selected tags

feat(tags): Blur input after adding tag

doc(tags): Initial tags documentation

fix(tags): Dark theme dropdown

fix(tags): Dark theme for tags on input

fix(tags): Dark theme for highlight in dropdown

fix(tags): Populate filter tags droplist

chore(): Bump zm_update to 1.37.42

chore(tags): Move mobile check to skin.js

chore(tags): Comment debug statements

fix(tags): Enter key to create tag on mobile Chome

chore(tags): Space in 'All Tags' for translation

Temporary commit to handle cookie expiration times

chore(tags): Remove unnecessary Tag(s) from en_gb

chore(): Cleanup unnecessary Error and Debug

chore(): Resolve merge conflicts

chore(): Address merge conflicts with master
2023-08-31 15:50:08 -04:00
Alejandro Criado-Pérez 6fd119157a Text corrections 2023-08-27 02:00:59 +02:00
Isaac Connor 969baa3891 Convert user from an array to a User object 2023-04-23 12:57:29 -04:00
Isaac Connor 357ce14c94 format endtime 2023-02-09 18:46:01 -05:00
Isaac Connor e10c1e8d65 Fix deprecation warning due to implicit conversion to integer. Make it explicit. 2022-08-10 09:18:39 -04:00
Isaac Connor e38dd4649d Convert missed strftimes to dateTimeFormatter. Fixes #3526 2022-07-13 18:47:27 -04:00
Ben Dailey ce267c7e3c Most programmatic images are lazy. 2022-02-22 08:31:02 -05:00
Andrew Bauer c13d2ea99f make watch view event list more efficient 2021-01-19 10:10:51 -06:00