<commit_before><?php
session_start();

ob_start();

include "./common.php";

$error = '';
$action_name = 'add';
$action_value = _('Add');

Admin::checkAuth();

Admin::checkAccess(AdminAccess::ACCESS_VIEW);

foreach (@$_POST as $key => $value){
    $_POST[$key] = trim($value);
}
    
if (@$_POST['add']){

    Admin::checkAccess(AdminAccess::ACCESS_CREATE);

    Mysql::getInstance()->insert('streaming_servers', array(
        'name'         => @$_POST['name'],
        'address'      => @$_POST['name'],
        'max_sessions' => @$_POST['max_sessions'],
        'stream_zone'  => @$_POST['stream_zone']
    ));

    header("Location: stream_servers.php");
    exit;
}

$id = @intval($_GET['id']);

if (!empty($id)){
    
    if (@$_POST['edit']){

        Admin::checkAccess(AdminAccess::ACCESS_EDIT);

        Mysql::getInstance()->update('',
            array(
                'name'         => @$_POST['name'],
                'address'      => @$_POST['address'],<commit_msg>Fixed stream server saving (issue #2582)<commit_after><?php
session_start();

ob_start();

include "./common.php";

$error = '';
$action_name = 'add';
$action_value = _('Add');

Admin::checkAuth();

Admin::checkAccess(AdminAccess::ACCESS_VIEW);

foreach (@$_POST as $key => $value){
    $_POST[$key] = trim($value);
}
    
if (@$_POST['add']){

    Admin::checkAccess(AdminAccess::ACCESS_CREATE);

    Mysql::getInstance()->insert('streaming_servers', array(
        'name'         => @$_POST['name'],
        'address'      => @$_POST['address'],
        'max_sessions' => @$_POST['max_sessions'],
        'stream_zone'  => @$_POST['stream_zone']
    ));

    header("Location: stream_servers.php");
    exit;
}

$id = @intval($_GET['id']);

if (!empty($id)){
    
    if (@$_POST['edit']){

        Admin::checkAccess(AdminAccess::ACCESS_EDIT);

        Mysql::getInstance()->update('streaming_servers',
            array(
                'name'         => @$_POST['name'],
                'address'      => @$_POST['address'],
{'fraction_non_alphanumeric': 0.2143212332173048, 'fraction_numerical': 0.001989060169070114, 'mean_word_length': 3.15702479338843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2352017', 'n_tokens_mistral': 656, 'n_tokens_neox': 646, 'n_words': 100}