<commit_before><?php

/*
*  Copyright (c) Codiad & <NAME> (codiad.com), distributed
*  as-is and without warranty under the MIT License. See
*  [root]/license.txt for more. This information must remain intact.
*/

class Active {

    //////////////////////////////////////////////////////////////////
    // PROPERTIES
    //////////////////////////////////////////////////////////////////

    public $username    = "";
    public $path        = "";
    public $new_path    = "";
    public $actives     = "";

    //////////////////////////////////////////////////////////////////
    // METHODS
    //////////////////////////////////////////////////////////////////

    // -----------------------------||----------------------------- //

    //////////////////////////////////////////////////////////////////
    // Construct
    //////////////////////////////////////////////////////////////////

    public function __construct(){
        $this->actives = getJSON('active.php');
    }

    //////////////////////////////////////////////////////////////////
    // List User's Active Files
    //////////////////////////////////////////////////////////////////

    public function ListActive(){
        $active_list = array();
        $tainted = FALSE;
        if($this->actives){
            foreach($this->actives as $active=>$data){
              if($data['username']==$this->username){
                if (file_exists(dirname(__FILE__)."/../../workspace".$data['path'])) {
                    $focused = isset($data['focused']) ? $data['focused'] : false;
                    $active_list[] = array('path'=>$data['path'], 'focused'=>$focused);
                } else {
                    unset($this->actives[$active]);
                    $tainted = TRUE;
                }<commit_msg>fixes #200 handles empty strings in active.php json Not sure of actual cause.<commit_after><?php

/*
*  Copyright (c) Codiad & <NAME> (codiad.com), distributed
*  as-is and without warranty under the MIT License. See
*  [root]/license.txt for more. This information must remain intact.
*/

class Active {

    //////////////////////////////////////////////////////////////////
    // PROPERTIES
    //////////////////////////////////////////////////////////////////

    public $username    = "";
    public $path        = "";
    public $new_path    = "";
    public $actives     = "";

    //////////////////////////////////////////////////////////////////
    // METHODS
    //////////////////////////////////////////////////////////////////

    // -----------------------------||----------------------------- //

    //////////////////////////////////////////////////////////////////
    // Construct
    //////////////////////////////////////////////////////////////////

    public function __construct(){
        $this->actives = getJSON('active.php');
    }

    //////////////////////////////////////////////////////////////////
    // List User's Active Files
    //////////////////////////////////////////////////////////////////

    public function ListActive(){
        $active_list = array();
        $tainted = FALSE;
        if($this->actives){
            foreach($this->actives as $active=>$data){
              if(is_array($data) && ($data['username'] == $this->username) ) {
                if (file_exists(dirname(__FILE__)."/../../workspace".$data['path'])) {
                    $focused = isset($data['focused']) ? $data['focused'] : false;
                    $active_list[] = array('path'=>$data['path'], 'focused'=>$focused);
                } else {
                    unset($this->actives[$active]);
                    $tainted = TRUE;
                }
{'fraction_non_alphanumeric': 0.42736899266901984, 'fraction_numerical': 0.0008145533532446375, 'mean_word_length': 0.7686029764762362, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7201296', 'n_tokens_mistral': 765, 'n_tokens_neox': 717, 'n_words': 156}