diff --git a/app/streams/resources/classes/streams.php b/app/streams/resources/classes/streams.php index 54c1c8ea08..05340cdfee 100644 --- a/app/streams/resources/classes/streams.php +++ b/app/streams/resources/classes/streams.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018-2019 + Portions created by the Initial Developer are Copyright (C) 2018-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -80,7 +80,7 @@ if (!class_exists('streams')) { //build the delete array foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid']; } } @@ -126,7 +126,7 @@ if (!class_exists('streams')) { //get current toggle state foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } } @@ -195,7 +195,7 @@ if (!class_exists('streams')) { //get checked records foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } } diff --git a/app/streams/stream_edit.php b/app/streams/stream_edit.php index 14d06c3891..171f2797da 100644 --- a/app/streams/stream_edit.php +++ b/app/streams/stream_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018-2020 + Portions created by the Initial Developer are Copyright (C) 2018-2023 the Initial Developer. All Rights Reserved. */ @@ -143,7 +143,7 @@ } //pre-populate the form - if (!empty($_GET) && $_POST["persistformvar"] != "true") { + if (!empty($_GET) && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) { $stream_uuid = $_GET["id"]; $sql = "select * from v_streams "; $sql .= "where stream_uuid = :stream_uuid "; diff --git a/app/streams/streams.php b/app/streams/streams.php index 2046c8be93..869b5e3faa 100644 --- a/app/streams/streams.php +++ b/app/streams/streams.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018-2022 + Portions created by the Initial Developer are Copyright (C) 2018-2023 the Initial Developer. All Rights Reserved. */ @@ -88,21 +88,21 @@ $order = $_GET["order"] ?? ''; //add the search term - if (isset($_GET["search"])) { - $search = strtolower($_GET["search"]); + if (!empty($_GET["search"])) { + $search = $_GET["search"]; } //prepare to page the results $sql = "select count(stream_uuid) from v_streams "; $sql .= "where true "; - if (isset($search) && $search != '') { - $sql = "and ("; + if (!empty($search)) { + $sql .= "and ("; $sql .= "lower(stream_name) like :search "; $sql .= "or lower(stream_location) like :search "; $sql .= "or lower(stream_enabled) like :search "; $sql .= "or lower(stream_description) like :search "; $sql .= ") "; - $parameters['search'] = '%'.$search.'%'; + $parameters['search'] = '%'.strtolower($search).'%'; } if (permission_exists('stream_all') && $show == "all") { //show all @@ -132,14 +132,14 @@ //get the list $sql = "select * from v_streams "; $sql .= "where true "; - if (isset($search) && $search != '') { - $sql = "and ("; + if (!empty($search)) { + $sql .= "and ("; $sql .= " lower(stream_name) like :search "; $sql .= " or lower(stream_location) like :search "; $sql .= " or lower(stream_enabled) like :search "; $sql .= " or lower(stream_description) like :search "; $sql .= ") "; - $parameters['search'] = '%'.$search.'%'; + $parameters['search'] = '%'.strtolower($search).'%'; } if (permission_exists('stream_all') && $show == "all") { //show all @@ -233,7 +233,7 @@ echo "\n"; if (permission_exists('stream_add') || permission_exists('stream_edit') || permission_exists('stream_delete')) { echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; } if ($show == 'all' && permission_exists('stream_all')) { @@ -261,7 +261,7 @@ echo " \n"; echo " \n"; } - if ($_GET['show'] == 'all' && permission_exists('stream_all')) { + if (!empty($_GET['show']) && $_GET['show'] == 'all' && permission_exists('stream_all')) { echo " "; if ($_SESSION['domains'][$row['domain_uuid']]['domain_name'] != '') { echo escape($_SESSION['domains'][$row['domain_uuid']]['domain_name']); @@ -283,7 +283,7 @@ if (!empty($row['stream_location'])) { $location_parts = explode('://',$row['stream_location']); $http_protocol = ($location_parts[0] == "shout") ? 'http' : 'https'; - echo "