!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/Extension/Attributes/Util/   drwxr-xr-x
Free 13.24 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:     AttributesHelper.php (3.67 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>
 * (c) 2015 Martin HasoĊˆ <martin.hason@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace 
League\CommonMark\Extension\Attributes\Util;

use 
League\CommonMark\Block\Element\AbstractBlock;
use 
League\CommonMark\Cursor;
use 
League\CommonMark\Inline\Element\AbstractInline;
use 
League\CommonMark\Util\RegexHelper;

/**
 * @internal
 */
final class AttributesHelper
{
    
/**
     * @param Cursor $cursor
     *
     * @return array<string, mixed>
     */
    
public static function parseAttributes(Cursor $cursor): array
    {
        
$state $cursor->saveState();
        
$cursor->advanceToNextNonSpaceOrNewline();
        if (
$cursor->getCharacter() !== '{') {
            
$cursor->restoreState($state);

            return [];
        }

        
$cursor->advanceBy(1);
        if (
$cursor->getCharacter() === ':') {
            
$cursor->advanceBy(1);
        }

        
$attributes = [];
        
$regex '/^\s*([.#][_a-z0-9-]+|' RegexHelper::PARTIAL_ATTRIBUTENAME RegexHelper::PARTIAL_ATTRIBUTEVALUESPEC ')(?<!})\s*/i';
        while (
$attribute \trim((string) $cursor->match($regex))) {
            if (
$attribute[0] === '#') {
                
$attributes['id'] = \substr($attribute1);

                continue;
            }

            if (
$attribute[0] === '.') {
                
$attributes['class'][] = \substr($attribute1);

                continue;
            }

            [
$name$value] = \explode('='$attribute2);
            
$first $value[0];
            
$last \substr($value, -1);
            if (((
$first === '"' && $last === '"') || ($first === "'" && $last === "'")) && \strlen($value) > 1) {
                
$value \substr($value1, -1);
            }

            if (
\strtolower(\trim($name)) === 'class') {
                foreach (
\array_filter(\explode(' '\trim($value))) as $class) {
                    
$attributes['class'][] = $class;
                }
            } else {
                
$attributes[trim($name)] = trim($value);
            }
        }

        if (
$cursor->match('/}/') === null) {
            
$cursor->restoreState($state);

            return [];
        }

        if (
$attributes === []) {
            
$cursor->restoreState($state);

            return [];
        }

        if (isset(
$attributes['class'])) {
            
$attributes['class'] = \implode(' ', (array) $attributes['class']);
        }

        return 
$attributes;
    }

    
/**
     * @param AbstractBlock|AbstractInline|array<string, mixed> $attributes1
     * @param AbstractBlock|AbstractInline|array<string, mixed> $attributes2
     *
     * @return array<string, mixed>
     */
    
public static function mergeAttributes($attributes1$attributes2): array
    {
        
$attributes = [];
        foreach ([
$attributes1$attributes2] as $arg) {
            if (
$arg instanceof AbstractBlock || $arg instanceof AbstractInline) {
                
$arg $arg->data['attributes'] ?? [];
            }

            
/** @var array<string, mixed> $arg */
            
$arg = (array) $arg;
            if (isset(
$arg['class'])) {
                foreach (
\array_filter(\explode(' '\trim($arg['class']))) as $class) {
                    
$attributes['class'][] = $class;
                }

                unset(
$arg['class']);
            }

            
$attributes \array_merge($attributes$arg);
        }

        if (isset(
$attributes['class'])) {
            
$attributes['class'] = \implode(' '$attributes['class']);
        }

        return 
$attributes;
    }
}

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