Code Duplication    Length = 3-4 lines in 3 locations

system/modules/StaticLoader/Controllers/StaticLoaderController.php 1 location

@@ 15-17 (lines=3) @@
12
13
    public function indexAction() {
14
        $path = $this->module->parsePath(implode('/', func_get_args()));
15
        if (!file_exists($path) && file_exists(mb_convert_encoding($path, 'Windows-1251', 'UTF-8'))) {
16
            $path = mb_convert_encoding($path, 'Windows-1251', 'UTF-8');
17
        }
18
        if (!file_exists($path)) {
19
            Tools::header(404, true);
20
        } else {

system/modules/StaticLoader/StaticLoader.php 1 location

@@ 82-84 (lines=3) @@
79
    }
80
81
    public function giveFile($file) {
82
        if (!file_exists($file) && file_exists(mb_convert_encoding($file, 'Windows-1251', 'UTF-8'))) {
83
            $file = mb_convert_encoding($file, 'Windows-1251', 'UTF-8');
84
        }
85
        if (!file_exists($file)) {
86
            header('HTTP/1.1 404 Not Found');
87
            exit();

system/Inji/Statics.php 1 location

@@ 31-34 (lines=4) @@
28
        $absolutePath = $pathAbsolute ? $path : App::$cur->staticLoader->parsePath($path);
29
30
        $convert = false;
31
        if (!file_exists($absolutePath) && file_exists(mb_convert_encoding($absolutePath, 'Windows-1251', 'UTF-8'))) {
32
            $absolutePath = mb_convert_encoding($absolutePath, 'Windows-1251', 'UTF-8');
33
            $convert = true;
34
        }
35
        if (!file_exists($absolutePath)) {
36
            return '';
37
        } else {