<commit_before><?php
/**
 * Created by PhpStorm.
 * User: garth
 * Date: 11/4/15
 * Time: 5:56 PM
 */
    // depending on the smartphone and the photo size, imagerotate below may eat up PHP memory, set it accordingly here.
    ini_set("memory_limit","128M");

    // TODO - classify this
    function logError($level,$message) {
        error_log($message,0);
        if($level == "fatal" && isset($_SERVER['SERVER_PROTOCOL'])) {
            $code = (string) "500";
            $status = return_status($code);
            $status ? header($status) : NULL ;
        //    include(getenv('DOCUMENT_ROOT') . "/inc/locale/en-us/".$code.".xml");
            die();
        } elseif($level == "fatal" && !isset($_SERVER['SERVER_PROTOCOL'])) {
            die("error");
        }
    }

    $success = FALSE;

    $request = array();
    $request['player_eval_id'] = isset($_POST['player_eval_id']) && $_POST['player_eval_id'] != "" ? (int) filter_var($_POST['player_eval_id'], FILTER_SANITIZE_NUMBER_INT) : FALSE;
    $request['player_sportsengine_id'] = isset($_POST['player_sportsengine_id']) && $_POST['player_sportsengine_id'] != "" ? (int) filter_var($_POST['player_sportsengine_id'], FILTER_SANITIZE_NUMBER_INT) : FALSE;
    $request['player_first_name'] = isset($_POST['player_first_name']) && $_POST['player_first_name'] != "" ? (string) filter_var($_POST['player_first_name'], FILTER_SANITIZE_STRING) : FALSE;
    $request['player_last_name'] = isset($_POST['player_last_name']) && $_POST['player_last_name'] != "" ? (string) filter_var($_POST['player_last_name'], FILTER_SANITIZE_STRING) : FALSE;
    $request['action'] = isset($_POST['action']) && $_POST['action'] != "" ? (string) filter_var($_POST['action'], FILTER_SANITIZE_STRING) : FALSE;
    $request['origin_lat'] = isset($_POST['origin_lat']) && $_POST['origin_lat'] != "" ? (float) filter_var($_POST['origin_lat'], FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION) : FALSE;
    $request['origin_lon'] = isset($_POST['origin_lon']) && $_POST['origin_lon'] != "" ? (float) filter_var($_POST['origin_lon'], FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION) : FALSE;

    define("EVAL_PHOTO_FILEPATH",getenv('DOCUMENT_ROOT')."/assets/img/players/");<commit_msg>updates for 2017 v5, don't encode quotes in first/last name input posts<commit_after><?php
/**
 * Created by PhpStorm.
 * User: garth
 * Date: 11/4/15
 * Time: 5:56 PM
 */
    // depending on the smartphone and the photo size, imagerotate below may eat up PHP memory, set it accordingly here.
    ini_set("memory_limit","128M");

    // TODO - classify this
    function logError($level,$message) {
        error_log($message,0);
        if($level == "fatal" && isset($_SERVER['SERVER_PROTOCOL'])) {
            $code = (string) "500";
            $status = return_status($code);
            $status ? header($status) : NULL ;
        //    include(getenv('DOCUMENT_ROOT') . "/inc/locale/en-us/".$code.".xml");
            die();
        } elseif($level == "fatal" && !isset($_SERVER['SERVER_PROTOCOL'])) {
            die("error");
        }
    }

    $success = FALSE;

    $request = array();
    $request['player_eval_id'] = isset($_POST['player_eval_id']) && $_POST['player_eval_id'] != "" ? (int) filter_var($_POST['player_eval_id'], FILTER_SANITIZE_NUMBER_INT) : FALSE;
    $request['player_sportsengine_id'] = isset($_POST['player_sportsengine_id']) && $_POST['player_sportsengine_id'] != "" ? (int) filter_var($_POST['player_sportsengine_id'], FILTER_SANITIZE_NUMBER_INT) : FALSE;
    $request['player_first_name'] = isset($_POST['player_first_name']) && $_POST['player_first_name'] != "" ? (string) filter_var($_POST['player_first_name'], FILTER_SANITIZE_STRING,FILTER_FLAG_NO_ENCODE_QUOTES) : FALSE;
    $request['player_last_name'] = isset($_POST['player_last_name']) && $_POST['player_last_name'] != "" ? (string) filter_var($_POST['player_last_name'], FILTER_SANITIZE_STRING,FILTER_FLAG_NO_ENCODE_QUOTES) : FALSE;
    $request['action'] = isset($_POST['action']) && $_POST['action'] != "" ? (string) filter_var($_POST['action'], FILTER_SANITIZE_STRING) : FALSE;
    $request['origin_lat'] = isset($_POST['origin_lat']) && $_POST['origin_lat'] != "" ? (float) filter_var($_POST['origin_lat'], FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION) : FALSE;
    $request['origin_lon'] = isset($_POST['origin_lon']) && $_POST['origin_lon'] != "" ? (float) filter_var($_POST['origin_lon'], FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION) : FALSE;

    define("EVAL_PHOTO_FILEPATH",getenv('DOCUMENT_ROOT')."/assets/img/players/");
{'fraction_non_alphanumeric': 0.18556476232010466, 'fraction_numerical': 0.007631923244657654, 'mean_word_length': 4.980443285528032, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6407647', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1525, 'n_words': 228}