<commit_before><?php
class API extends RESTful
{
    /** @var  Buckets $buckets */
    private $buckets;
    function main()
    {
        $this->sendCorsHeaders('GET,POST');
        if(!$this->checkMethod('GET,POST')) return;

        if(!$this->core->config->get('bucketUploadPathTest')) return($this->setErrorFromCodelib('system-error','missing bucketUploadPathTest config var'));
        $this->buckets = $this->core->loadClass('Buckets',$this->core->config->get('bucketUploadPathTest'));
        if($this->buckets->error) return($this->setErrorFromCodelib('system-error',$this->buckets->errorMsg));

        // Call endpoints
        if(!$this->useFunction('ENDPOINT_'.$this->params[0]))  return($this->setErrorFromCodelib('params-error'));

    }

    /**
     * get uploadUrl to send files
     */
    public function ENDPOINT_uploadUrl() {

        // To pass info using session
        $this->core->session->init();

        $public = ($this->formParams['public'])?true:false;
        $ssl = ($this->formParams['ssl'])?true:false;
        $apply_hash_to_filenames = ($this->formParams['apply_hash_to_filenames'])?true:false;
        $allowed_content_types = ($this->formParams['allowed_content_types'])?:'';
        $allowed_extensions = ($this->formParams['allowed_extensions'])?:'';

        $upload_properties = ['public'=>$public,'ssl'=>$ssl,'apply_hash_to_filenames'=>$apply_hash_to_filenames,'allowed_content_types'=>$allowed_content_types,'allowed_extensions'=>$allowed_extensions];
        $this->core->session->set('_uploadProperties',$upload_properties);

        // The return URL once the files have been sent to process those files
        $retUrl = $this->core->system->url['host_base_url'].'/h/api/_upload/manageFiles';
<commit_msg>Fix upload retUrl and no index arrays<commit_after><?php
class API extends RESTful
{
    /** @var  Buckets $buckets */
    private $buckets;
    function main()
    {

        $this->sendCorsHeaders('GET,POST');
        if(!$this->checkMethod('GET,POST')) return;

        if(!$this->core->config->get('bucketUploadPathTest')) return($this->setErrorFromCodelib('system-error','missing bucketUploadPathTest config var'));
        $this->buckets = $this->core->loadClass('Buckets',$this->core->config->get('bucketUploadPathTest'));
        if($this->buckets->error) return($this->setErrorFromCodelib('system-error',$this->buckets->errorMsg));

        // Call endpoints
        if(!$this->useFunction('ENDPOINT_'.$this->params[0]))  return($this->setErrorFromCodelib('params-error','use [POST]/_upload/uploadUrl'));

    }

    /**
     * get uploadUrl to send files
     */
    public function ENDPOINT_uploadUrl() {

        // To pass info using session
        $this->core->session->init();

        $public = (isset($this->formParams['public']) && $this->formParams['public'])?true:false;
        $ssl = (isset($this->formParams['ssl']) && $this->formParams['ssl'])?true:false;
        $apply_hash_to_filenames = (isset($this->formParams['apply_hash_to_filenames']) && $this->formParams['apply_hash_to_filenames'])?true:false;
        $allowed_content_types = (isset($this->formParams['allowed_content_types']) && $this->formParams['allowed_content_types'])?$this->formParams['allowed_content_types']:'';
        $allowed_extensions = (isset($this->formParams['allowed_extensions']) && $this->formParams['allowed_extensions'])?$this->formParams['allowed_extensions']:'';

        $upload_properties = ['public'=>$public,'ssl'=>$ssl,'apply_hash_to_filenames'=>$apply_hash_to_filenames,'allowed_content_types'=>$allowed_content_types,'allowed_extensions'=>$allowed_extensions];
        $this->core->session->set('_uploadProperties',$upload_properties);

        // The return URL once the files have been sent to process those files
        $retUrl = str_replace('uploadUrl','manageFiles',$this->core->system->url['host_url']);

{'fraction_non_alphanumeric': 0.18095238095238095, 'fraction_numerical': 0.0005148005148005148, 'mean_word_length': 4.607503607503608, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 88, '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': '6399176', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1142, 'n_words': 152}