<commit_before><?php
/**
 *                    Jojo CMS
 *                ================
 *
 * Copyright 2008 <NAME> <<EMAIL>>
 *
 * See the enclosed file license.txt for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @author  <NAME> <<EMAIL>>
 * @license http://www.fsf.org/copyleft/lgpl.html GNU Lesser General Public License
 * @link    http://www.jojocms.org JojoCMS
 * @package jojo_core
 */

class Jojo_Plugin_Core_Json extends Jojo_Plugin_Core {

    /**
     * Output the JSON responce
     *
     * In the getCorrectUrl function so we can interupt the code execution
     * without the overhead of all the smarty setup etc
     */
    function __construct()
    {
        /* Get requested filename */
        $file = Jojo::getFormData('file', false);

        /* Check file name is not empty */
        if (!$file) {
            /* Not found, 404 time */
            header("HTTP/1.0 404 Not Found", true, 404);
            exit;
        }
        $files = Jojo::listPlugins('json/' . $file);
        if (isset($files[0])) {
            $file = $files[0];
        } else {
            /* Not found, 404 time */
            header("HTTP/1.0 404 Not Found", true, 404);
            exit;
        }

        /* Change to directory */
        chdir(dirname($file));

        /* Include the php file */
        header('Content-Type: application/javascript; charset=utf-8');
        global $_USERID, $_USERGROUPS;
        include($file);
        exit;
   }
}<commit_msg>Core - Allow json overrides in theme/plugins etc<commit_after><?php
/**
 *                    Jojo CMS
 *                ================
 *
 * Copyright 2008 <NAME> <<EMAIL>>
 *
 * See the enclosed file license.txt for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @author  <NAME> <<EMAIL>>
 * @license http://www.fsf.org/copyleft/lgpl.html GNU Lesser General Public License
 * @link    http://www.jojocms.org JojoCMS
 * @package jojo_core
 */

class Jojo_Plugin_Core_Json extends Jojo_Plugin_Core {

    /**
     * Output the JSON responce
     *
     * In the getCorrectUrl function so we can interupt the code execution
     * without the overhead of all the smarty setup etc
     */
    function __construct()
    {
        /* Get requested filename */
        $file = Jojo::getFormData('file', false);

        /* Check file name is not empty */
        if (!$file) {
            /* Not found, 404 time */
            header("HTTP/1.0 404 Not Found", true, 404);
            exit;
        }
        /* Check for override in a Theme */
        $files = Jojo::listThemes('json/' . $file);

        if (isset($files[0])) {
            $file = $files[0];
        } else {
            /* Check for external in a Plugin */
            $files = Jojo::listPlugins('json/' . $file);
            if (isset($files[0])) {
                $file = $files[0];
            } else {
                /* Not found, 404 time */
                header("HTTP/1.0 404 Not Found", true, 404);
                exit;
            }
        }

        /* Change to directory */
        chdir(dirname($file));

        /* Include the php file */
        header('Content-Type: application/javascript; charset=utf-8');
        global $_USERID, $_USERGROUPS;
        include($file);
        exit;
   }
}



{'fraction_non_alphanumeric': 0.13716814159292035, 'fraction_numerical': 0.017699115044247787, 'mean_word_length': 1.8094449047224523, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '3013088', 'n_tokens_mistral': 1047, 'n_tokens_neox': 965, 'n_words': 286}