!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/composer/composer/src/Composer/Util/   drwxr-xr-x
Free 13.25 GB of 57.97 GB (22.86%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Url.php (5.06 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Util;

use 
Composer\Config;

/**
 * @author Jordi Boggiano <j.boggiano@seld.be>
 */
class Url
{
    
/**
     * @param  Config $config
     * @param  string $url
     * @param  string $ref
     * @return string the updated URL
     */
    
public static function updateDistReference(Config $config$url$ref)
    {
        
$host parse_url($urlPHP_URL_HOST);

        if (
$host === 'api.github.com' || $host === 'github.com' || $host === 'www.github.com') {
            if (
preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/(zip|tar)ball/(.+)$}i'$url$match)) {
                
// update legacy github archives to API calls with the proper reference
                
$url 'https://api.github.com/repos/' $match[1] . '/'$match[2] . '/' $match[3] . 'ball/' $ref;
            } elseif (
preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/archive/.+\.(zip|tar)(?:\.gz)?$}i'$url$match)) {
                
// update current github web archives to API calls with the proper reference
                
$url 'https://api.github.com/repos/' $match[1] . '/'$match[2] . '/' $match[3] . 'ball/' $ref;
            } elseif (
preg_match('{^https?://api\.github\.com/repos/([^/]+)/([^/]+)/(zip|tar)ball(?:/.+)?$}i'$url$match)) {
                
// update api archives to the proper reference
                
$url 'https://api.github.com/repos/' $match[1] . '/'$match[2] . '/' $match[3] . 'ball/' $ref;
            }
        } elseif (
$host === 'bitbucket.org' || $host === 'www.bitbucket.org') {
            if (
preg_match('{^https?://(?:www\.)?bitbucket\.org/([^/]+)/([^/]+)/get/(.+)\.(zip|tar\.gz|tar\.bz2)$}i'$url$match)) {
                
// update Bitbucket archives to the proper reference
                
$url 'https://bitbucket.org/' $match[1] . '/'$match[2] . '/get/' $ref '.' $match[4];
            }
        } elseif (
$host === 'gitlab.com' || $host === 'www.gitlab.com') {
            if (
preg_match('{^https?://(?:www\.)?gitlab\.com/api/v[34]/projects/([^/]+)/repository/archive\.(zip|tar\.gz|tar\.bz2|tar)\?sha=.+$}i'$url$match)) {
                
// update Gitlab archives to the proper reference
                
$url 'https://gitlab.com/api/v4/projects/' $match[1] . '/repository/archive.' $match[2] . '?sha=' $ref;
            }
        } elseif (
in_array($host$config->get('github-domains'), true)) {
            
$url preg_replace('{(/repos/[^/]+/[^/]+/(zip|tar)ball)(?:/.+)?$}i''$1/'.$ref$url);
        } elseif (
in_array($host$config->get('gitlab-domains'), true)) {
            
$url preg_replace('{(/api/v[34]/projects/[^/]+/repository/archive\.(?:zip|tar\.gz|tar\.bz2|tar)\?sha=).+$}i''${1}'.$ref$url);
        }

        return 
$url;
    }

    
/**
     * @param  string $url
     * @return string
     */
    
public static function getOrigin(Config $config$url)
    {
        if (
=== strpos($url'file://')) {
            return 
$url;
        }

        
$origin = (string) parse_url($urlPHP_URL_HOST);
        if (
$port parse_url($urlPHP_URL_PORT)) {
            
$origin .= ':'.$port;
        }

        if (
strpos($origin'.github.com') === (strlen($origin) - 11)) {
            return 
'github.com';
        }

        if (
$origin === 'repo.packagist.org') {
            return 
'packagist.org';
        }

        if (
$origin === '') {
            
$origin $url;
        }

        
// Gitlab can be installed in a non-root context (i.e. gitlab.com/foo). When downloading archives the originUrl
        // is the host without the path, so we look for the registered gitlab-domains matching the host here
        
if (
            
is_array($config->get('gitlab-domains'))
            && 
false === strpos($origin'/')
            && !
in_array($origin$config->get('gitlab-domains'))
        ) {
            foreach (
$config->get('gitlab-domains') as $gitlabDomain) {
                if (
=== strpos($gitlabDomain$origin)) {
                    return 
$gitlabDomain;
                }
            }
        }

        return 
$origin;
    }

    public static function 
sanitize($url)
    {
        
// GitHub repository rename result in redirect locations containing the access_token as GET parameter
        // e.g. https://api.github.com/repositories/9999999999?access_token=github_token
        
$url preg_replace('{([&?]access_token=)[^&]+}''$1***'$url);

        
$url preg_replace_callback('{(?P<prefix>://|^)(?P<user>[^:/\s@]+):(?P<password>[^@\s/]+)@}i', function ($m) {
            
// if the username looks like a long (12char+) hex string, or a modern github token (e.g. gp1_xxx) we obfuscate that
            
if (preg_match('{^([a-f0-9]{12,}|g[a-z]\d_[a-zA-Z0-9_]+)$}'$m['user'])) {
                return 
$m['prefix'].'***:***@';
            }

            return 
$m['prefix'].$m['user'].':***@';
        }, 
$url);

        return 
$url;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0051 ]--