!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/league/commonmark/src/Block/Parser/   drwxr-xr-x
Free 13.25 GB of 57.97 GB (22.85%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/*
 * This file is part of the league/commonmark package.
 *
 * (c) Colin O'Dell <colinodell@gmail.com>
 *
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
 *  - (c) John MacFarlane
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace League\CommonMark\Block\Parser;

use 
League\CommonMark\Block\Element\ListBlock;
use 
League\CommonMark\Block\Element\ListData;
use 
League\CommonMark\Block\Element\ListItem;
use 
League\CommonMark\Block\Element\Paragraph;
use 
League\CommonMark\ContextInterface;
use 
League\CommonMark\Cursor;
use 
League\CommonMark\Util\ConfigurationAwareInterface;
use 
League\CommonMark\Util\ConfigurationInterface;
use 
League\CommonMark\Util\RegexHelper;

final class 
ListParser implements BlockParserInterfaceConfigurationAwareInterface
{
    
/** @var ConfigurationInterface|null */
    
private $config;

    
/** @var string|null */
    
private $listMarkerRegex;

    public function 
setConfiguration(ConfigurationInterface $configuration)
    {
        
$this->config $configuration;
    }

    public function 
parse(ContextInterface $contextCursor $cursor): bool
    
{
        if (
$cursor->isIndented() && !($context->getContainer() instanceof ListBlock)) {
            return 
false;
        }

        
$indent $cursor->getIndent();
        if (
$indent >= 4) {
            return 
false;
        }

        
$tmpCursor = clone $cursor;
        
$tmpCursor->advanceToNextNonSpaceOrTab();
        
$rest $tmpCursor->getRemainder();

        if (
\preg_match($this->listMarkerRegex ?? $this->generateListMarkerRegex(), $rest) === 1) {
            
$data = new ListData();
            
$data->markerOffset $indent;
            
$data->type ListBlock::TYPE_BULLET;
            
$data->delimiter null;
            
$data->bulletChar $rest[0];
            
$markerLength 1;
        } elseif ((
$matches RegexHelper::matchAll('/^(\d{1,9})([.)])/'$rest)) && (!($context->getContainer() instanceof Paragraph) || $matches[1] === '1')) {
            
$data = new ListData();
            
$data->markerOffset $indent;
            
$data->type ListBlock::TYPE_ORDERED;
            
$data->start = (int) $matches[1];
            
$data->delimiter $matches[2];
            
$data->bulletChar null;
            
$markerLength \strlen($matches[0]);
        } else {
            return 
false;
        }

        
// Make sure we have spaces after
        
$nextChar $tmpCursor->peek($markerLength);
        if (!(
$nextChar === null || $nextChar === "\t" || $nextChar === ' ')) {
            return 
false;
        }

        
// If it interrupts paragraph, make sure first line isn't blank
        
$container $context->getContainer();
        if (
$container instanceof Paragraph && !RegexHelper::matchAt(RegexHelper::REGEX_NON_SPACE$rest$markerLength)) {
            return 
false;
        }

        
// We've got a match! Advance offset and calculate padding
        
$cursor->advanceToNextNonSpaceOrTab(); // to start of marker
        
$cursor->advanceBy($markerLengthtrue); // to end of marker
        
$data->padding $this->calculateListMarkerPadding($cursor$markerLength);

        
// add the list if needed
        
if (!($container instanceof ListBlock) || !$data->equals($container->getListData())) {
            
$context->addBlock(new ListBlock($data));
        }

        
// add the list item
        
$context->addBlock(new ListItem($data));

        return 
true;
    }

    
/**
     * @param Cursor $cursor
     * @param int    $markerLength
     *
     * @return int
     */
    
private function calculateListMarkerPadding(Cursor $cursorint $markerLength): int
    
{
        
$start $cursor->saveState();
        
$spacesStartCol $cursor->getColumn();

        while (
$cursor->getColumn() - $spacesStartCol 5) {
            if (!
$cursor->advanceBySpaceOrTab()) {
                break;
            }
        }

        
$blankItem $cursor->peek() === null;
        
$spacesAfterMarker $cursor->getColumn() - $spacesStartCol;

        if (
$spacesAfterMarker >= || $spacesAfterMarker || $blankItem) {
            
$cursor->restoreState($start);
            
$cursor->advanceBySpaceOrTab();

            return 
$markerLength 1;
        }

        return 
$markerLength $spacesAfterMarker;
    }

    private function 
generateListMarkerRegex(): string
    
{
        
// No configuration given - use the defaults
        
if ($this->config === null) {
            return 
$this->listMarkerRegex '/^[*+-]/';
        }

        
$markers $this->config->get('unordered_list_markers', ['*''+''-']);

        if (!
\is_array($markers)) {
            throw new 
\RuntimeException('Invalid configuration option "unordered_list_markers": value must be an array of strings');
        }

        return 
$this->listMarkerRegex '/^[' \preg_quote(\implode(''$markers), '/') . ']/';
    }
}

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