MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/public_html/finance/vendor/league/plates/src/Extension/Folders/folders.php
<?php

namespace League\Plates\Extension\Folders;

use League\Plates;
use League\Plates\Extension\Path\ResolvePathArgs;

function foldersResolvePath(array $folders, $sep = '::', $file_exists = 'file_exists') {
    return function(ResolvePathArgs $args, $next) use ($folders, $sep, $file_exists) {
        if (strpos($args->path, $sep) === false) {
            return $next($args);
        }

        list($folder, $name) = explode($sep, $args->path);
        if (!isset($folders[$folder])) {
            return $next($args);
        }
        $folder_struct = $folders[$folder];

        foreach ($folder_struct['prefixes'] as $prefix) {
            $path = $next($args->withPath(
                Plates\Util\joinPath([$prefix, $name])
            ));

            // no need to check if file exists if we only have prefix
            if (count($folder_struct['prefixes']) == 1 || $file_exists($path)) {
                return $path;
            }
        }

        // none of the paths matched, just return what we have.
        return $path;
    };
}

function stripFoldersNormalizeName(array $folders, $sep = '::') {
    return function($name) use ($folders, $sep) {
        foreach ($folders as $folder) {
            foreach (array_filter($folder['prefixes']) as $prefix) {
                if (strpos($name, $prefix) === 0) {
                    return $folder['folder'] . $sep . substr($name, strlen($prefix) + 1);
                }
            }
        }

        return $name;
    };
}