<commit_before><?php

    //sc/upload/image.php
    include ('sc-app.inc');
    include(APP_WEB_DIR . '/inc/header.inc');
    require_once(WEBGLOO_LIB_ROOT. '/ext/S3.php');

    set_error_handler('webgloo_ajax_error_handler');
    
    use \com\indigloo\Util as Util;
    use \com\indigloo\sc\auth\Login as Login ;


    //use login is required for bookmarking
    if(!Login::hasSession()) {
        $message = array("code" => 401 , "message" => "Authentication failure: You need to login!");
        $json = json_encode($message); 
        echo $json;
        exit;
    }

    $uploader =  NULL ; 
    $prefix = sprintf("%s/",date('Y/m/d')) ;
    
    //special prefix - test machines 
    if($_SERVER["HTTP_HOST"] == 'mint.3mik.com' || $_SERVER["HTTP_HOST"] == 'mbp13.3mik.com') {
        $prefix = 'test/'.$prefix ;
    }
        
    if (isset($_GET['qqfile'])) {
        $pipe = new \com\indigloo\media\XhrPipe();
        $uploader = new com\indigloo\media\ImageUpload($pipe);
        $uploader->process($prefix,$_GET['qqfile']);
        
    } elseif (isset($_FILES['qqfile'])) {

        $pipe = new \com\indigloo\media\FormPipe();
        $uploader = new com\indigloo\media\ImageUpload($pipe);
        $uploader->process($prefix,"qqfile");
        
    } else {
        trigger_error("what is this?", E_USER_ERROR); 
    }<commit_msg> fixed error message<commit_after><?php

    //sc/upload/image.php
    include ('sc-app.inc');
    include(APP_WEB_DIR . '/inc/header.inc');
    require_once(WEBGLOO_LIB_ROOT. '/ext/S3.php');

    set_error_handler('webgloo_ajax_error_handler');
    
    use \com\indigloo\Util as Util;
    use \com\indigloo\sc\auth\Login as Login ;


    //use login is required for bookmarking
    if(!Login::hasSession()) {
        $message = array("code" => 401 , "message" => "Authentication failure: You need to login!");
        $json = json_encode($message); 
        echo $json;
        exit;
    }

    $uploader =  NULL ; 
    $prefix = sprintf("%s/",date('Y/m/d')) ;
    
    //special prefix - test machines 
    if($_SERVER["HTTP_HOST"] == 'mint.3mik.com' || $_SERVER["HTTP_HOST"] == 'mbp13.3mik.com') {
        $prefix = 'test/'.$prefix ;
    }
        
    if (isset($_GET['qqfile'])) {
        $pipe = new \com\indigloo\media\XhrPipe();
        $uploader = new com\indigloo\media\ImageUpload($pipe);
        $uploader->process($prefix,$_GET['qqfile']);
        
    } elseif (isset($_FILES['qqfile'])) {

        $pipe = new \com\indigloo\media\FormPipe();
        $uploader = new com\indigloo\media\ImageUpload($pipe);
        $uploader->process($prefix,"qqfile");
        
    } else {
        trigger_error("file upload is unable to determine pipe", E_USER_ERROR); 
    }
{'fraction_non_alphanumeric': 0.17335296282664703, 'fraction_numerical': 0.005888847994111152, 'mean_word_length': 2.548302872062663, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1265420', 'n_tokens_mistral': 950, 'n_tokens_neox': 911, 'n_words': 159}