num_rows < 1) { JError("cannot edit stream"); } //Fix input $ip = rtrim($ip, "/"); $ip = ltrim($ip, "http://"); $ip = ltrim($ip, "https://"); $path = ltrim($path, "/"); //Check if stream is valid $resp = stream_verify($ip, $port, $path); if($resp === false) { JError("invalid stream"); } $ip = $resp; //Update stream $sql = "UPDATE `stream` SET `name`='$name', `ip`='$ip', `port`='$port', `path`='$path' WHERE `id`=$stream"; ExecQuery($mysqli, $sql); JSuccess("true"); ?>