<?php /*

 Composr
 Copyright (c) ocProducts, 2004-2016

 See text/EN/licence.txt for full licencing information.


 NOTE TO PROGRAMMERS:
   Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
   **** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****

*/

/**
 * @license    http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
 * @copyright  ocProducts Ltd
 * @package    stats
 */

/**
 * Output a cached stats SVG file.
 *
 * @ignore
 */
function stats_graph_script()
{
    header('Content-Type: image/svg+xml');

    // TODO: Review in v11, need to run some standard request code?

    $file = filter_naughty(get_param_string('file'));

    $path = get_custom_file_base() . '/data_custom/modules/admin_stats/' . $file . '.xml';

    if (file_exists($path)) {
        echo file_get_contents($path);
    }
}
