From 85f4981ad457cc976e17b9c49f7f6ec99902fa85 Mon Sep 17 00:00:00 2001 From: singhharsh1708 Date: Tue, 17 Nov 2026 01:12:07 +0530 Subject: [PATCH] fix: send moveStop again on rotated and flipped PTZ monitors --- web/includes/control_functions.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/web/includes/control_functions.php b/web/includes/control_functions.php index e6d4ed2735..84262644bc 100644 --- a/web/includes/control_functions.php +++ b/web/includes/control_functions.php @@ -212,9 +212,11 @@ function buildControlCommand($monitor) { 'DownRight' => 'UpRight', ), ); - $new_dirn = $conversions[$monitor->Orientation()][$dirn]; - $_REQUEST['control'] = preg_replace( "/$dirn\$/", "$new_dirn", $_REQUEST['control'] ); - $dirn = $new_dirn; + if ( isset($conversions[$monitor->Orientation()][$dirn]) ) { + $new_dirn = $conversions[$monitor->Orientation()][$dirn]; + $_REQUEST['control'] = preg_replace( "/$dirn\$/", "$new_dirn", $_REQUEST['control'] ); + $dirn = $new_dirn; + } } if ( $control->HasPanSpeed() && $xFactor ) { @@ -712,9 +714,11 @@ function buildControlCommand($monitor) { 'DownRight' => 'UpRight', ), ); - $new_dirn = $conversions[$monitor->Orientation()][$dirn]; - $_REQUEST['control'] = preg_replace( "/$dirn\$/", "$new_dirn", $_REQUEST['control'] ); - $dirn = $new_dirn; + if ( isset($conversions[$monitor->Orientation()][$dirn]) ) { + $new_dirn = $conversions[$monitor->Orientation()][$dirn]; + $_REQUEST['control'] = preg_replace( "/$dirn\$/", "$new_dirn", $_REQUEST['control'] ); + $dirn = $new_dirn; + } } if ( $control->HasPanSpeed() && $xFactor ) {