!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)

/var/www/html/queuepro/vendor/league/commonmark/src/Extension/Autolink/   drwxrwxr-x
Free 13.03 GB of 57.97 GB (22.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     UrlAutolinkParser.php (6.46 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

/*
 * This file is part of the league/commonmark package.
 *
 * (c) Colin O'Dell <colinodell@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace League\CommonMark\Extension\Autolink;

use 
League\CommonMark\Extension\CommonMark\Node\Inline\Link;
use 
League\CommonMark\Parser\Inline\InlineParserInterface;
use 
League\CommonMark\Parser\Inline\InlineParserMatch;
use 
League\CommonMark\Parser\InlineParserContext;

final class 
UrlAutolinkParser implements InlineParserInterface
{
    private const 
ALLOWED_AFTER = [null' '"\t""\n""\x0b""\x0c""\x0d"'*''_''~''('];

    
// RegEx adapted from https://github.com/symfony/symfony/blob/4.2/src/Symfony/Component/Validator/Constraints/UrlValidator.php
    
private const REGEX '~
        (
            # Must start with a supported scheme + auth, or "www"
            (?:
                (?:%s)://                                 # protocol
                (?:([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)?      # basic auth
            |www\.)
            (?:
                (?:[\pL\pN\pS\-\.])+(?:\.?(?:[\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
                    |                                                 # or
                \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}                    # an IP address
                    |                                                 # or
                \[
                    (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))
                \]  # an IPv6 address
            )
            (?::[0-9]+)?                              # a port (optional)
            (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )*      # a path
            (?:\? (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )?   # a query (optional)
            (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )?   # a fragment (optional)
        )~ixu'
;

    
/**
     * @var string[]
     *
     * @psalm-readonly
     */
    
private array $prefixes = ['www'];

    
/** @psalm-readonly */
    
private string $finalRegex;

    
/**
     * @param array<int, string> $allowedProtocols
     */
    
public function __construct(array $allowedProtocols = ['http''https''ftp'])
    {
        
$this->finalRegex \sprintf(self::REGEX\implode('|'$allowedProtocols));

        foreach (
$allowedProtocols as $protocol) {
            
$this->prefixes[] = $protocol '://';
        }
    }

    public function 
getMatchDefinition(): InlineParserMatch
    
{
        return 
InlineParserMatch::oneOf(...$this->prefixes);
    }

    public function 
parse(InlineParserContext $inlineContext): bool
    
{
        
$cursor $inlineContext->getCursor();

        
// Autolinks can only come at the beginning of a line, after whitespace, or certain delimiting characters
        
$previousChar $cursor->peek(-1);
        if (! 
\in_array($previousCharself::ALLOWED_AFTERtrue)) {
            return 
false;
        }

        
// Check if we have a valid URL
        
if (! \preg_match($this->finalRegex$cursor->getRemainder(), $matches)) {
            return 
false;
        }

        
$url $matches[0];

        
// Does the URL end with punctuation that should be stripped?
        
if (\preg_match('/(.+)([?!.,:*_~]+)$/'$url$matches)) {
            
// Add the punctuation later
            
$url $matches[1];
        }

        
// Does the URL end with something that looks like an entity reference?
        
if (\preg_match('/(.+)(&[A-Za-z0-9]+;)$/'$url$matches)) {
            
$url $matches[1];
        }

        
// Does the URL need unmatched parens chopped off?
        
if (\substr($url, -1) === ')' && ($diff self::diffParens($url)) > 0) {
            
$url \substr($url0, -$diff);
        }

        
$cursor->advanceBy(\mb_strlen($url));

        
// Auto-prefix 'http://' onto 'www' URLs
        
if (\substr($url04) === 'www.') {
            
$inlineContext->getContainer()->appendChild(new Link('http://' $url$url));

            return 
true;
        }

        
$inlineContext->getContainer()->appendChild(new Link($url$url));

        return 
true;
    }

    
/**
     * @psalm-pure
     */
    
private static function diffParens(string $content): int
    
{
        
// Scan the entire autolink for the total number of parentheses.
        // If there is a greater number of closing parentheses than opening ones,
        // we don’t consider ANY of the last characters as part of the autolink,
        // in order to facilitate including an autolink inside a parenthesis.
        
\preg_match_all('/[()]/'$content$matches);

        
$charCount = ['(' => 0')' => 0];
        foreach (
$matches[0] as $char) {
            
$charCount[$char]++;
        }

        return 
$charCount[')'] - $charCount['('];
    }
}

:: 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.0128 ]--