Implemented Not working CDN in v3.8.0

Status
Not open for further replies.

Rodolfo

Chevereto Developer
Chevereto Staff
It has been reported that CDN doesn't work in v3.8.0. To fix this, open app/lib/functions.php

Replace this:
PHP:
function get_image_fileinfo($file) {
    $extension = G\get_file_extension($file);
    return [
        'filename'    => basename($file), // image.jpg
        'name'        => basename($file, '.' . $extension), // image
        'mime'        => G\extension_to_mime($extension),
        'extension'    => $extension,
        'url'         => G\is_url($file) ? $file : G\absolute_to_url($file)
    ];
}
With this:
PHP:
function get_image_fileinfo($file) {
    $extension = G\get_file_extension($file);
    $return = [
        'filename'    => basename($file), // image.jpg
        'name'        => basename($file, '.' . $extension), // image
        'mime'        => G\extension_to_mime($extension),
        'extension'    => $extension,
        'url'         => G\is_url($file) ? $file : G\absolute_to_url($file)
    ];
    if(defined('CHV_ROOT_URL_STATIC')) {
        $return['url'] = preg_replace('#'.G_ROOT_URL.'#', CHV_ROOT_URL_STATIC, $return['url'], 1);
    }
    return $return;
}
Cheers,
Rodolfo.
 
Last edited:
Status
Not open for further replies.
Top