<commit_before><?php

// ALL PUT FUNCTIONS:
// INSERT, UPDATE, UPSERT, DELETE, UNDELETE, AND PURGE


/**
 * Main logic and control flow for all PUT funcions
 * @param unknown_type $action
 */
function put($action) {
    $confirmAction = 'Confirm ' . ucwords($action);

    if (isset($_POST['action']) && $_POST['action'] == $confirmAction) {

        if (isset($_POST['sourceType']) && $_POST['sourceType'] == "singleRecord") {
            $singleRecordCsv = array();

            if (requiresObject($action)) {
                $fields = WorkbenchContext::get()->describeSObjects(WorkbenchContext::get()->getDefaultObject())->fields;
            } else {
                $idField = new stdClass();
                $idField->name = "Id";
                $fields['Id'] = $idField;
            }

            $singleRecordFieldMap = convertFieldMapToArray($_POST, fieldsToNameArray($fields));
            
            $anySet = false;
            foreach ($fields as $field) {
                if (isset($_POST[$field->name])) {
                    $anySet |= $_POST[$field->name] != "";<commit_msg>strip slashes for magic quotes on single row dml<commit_after><?php

// ALL PUT FUNCTIONS:
// INSERT, UPDATE, UPSERT, DELETE, UNDELETE, AND PURGE


/**
 * Main logic and control flow for all PUT funcions
 * @param unknown_type $action
 */
function put($action) {
    $confirmAction = 'Confirm ' . ucwords($action);

    if (isset($_POST['action']) && $_POST['action'] == $confirmAction) {

        if (isset($_POST['sourceType']) && $_POST['sourceType'] == "singleRecord") {
            $singleRecordCsv = array();

            if (requiresObject($action)) {
                $fields = WorkbenchContext::get()->describeSObjects(WorkbenchContext::get()->getDefaultObject())->fields;
            } else {
                $idField = new stdClass();
                $idField->name = "Id";
                $fields['Id'] = $idField;
            }

            $singleRecordFieldMap = convertFieldMapToArray($_POST, fieldsToNameArray($fields));
            
            $anySet = false;
            foreach ($fields as $field) {
                if (isset($_POST[$field->name])) {
                    if (get_magic_quotes_gpc()) {
                        $_POST[$field->name] = stripslashes($_POST[$field->name]);
                    }

                    $anySet |= $_POST[$field->name] != "";
{'fraction_non_alphanumeric': 0.15707685846283073, 'fraction_numerical': 0.0, 'mean_word_length': 2.205921938088829, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3171951', 'n_tokens_mistral': 675, 'n_tokens_neox': 632, 'n_words': 138}