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


Viewing file:     JsonFormatter.php (4.41 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\Json;

/**
 * Formats json strings used for php < 5.4 because the json_encode doesn't
 * supports the flags JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE
 * in these versions
 *
 * @author Konstantin Kudryashiv <ever.zet@gmail.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 */
class JsonFormatter
{
    
/**
     * This code is based on the function found at:
     *  http://recursive-design.com/blog/2008/03/11/format-json-with-php/
     *
     * Originally licensed under MIT by Dave Perrett <mail@recursive-design.com>
     *
     *
     * @param  string $json
     * @param  bool   $unescapeUnicode Un escape unicode
     * @param  bool   $unescapeSlashes Un escape slashes
     * @return string
     */
    
public static function format($json$unescapeUnicode$unescapeSlashes)
    {
        
$result '';
        
$pos 0;
        
$strLen strlen($json);
        
$indentStr '    ';
        
$newLine "\n";
        
$outOfQuotes true;
        
$buffer '';
        
$noescape true;

        for (
$i 0$i $strLen$i++) {
            
// Grab the next character in the string
            
$char substr($json$i1);

            
// Are we inside a quoted string?
            
if ('"' === $char && $noescape) {
                
$outOfQuotes = !$outOfQuotes;
            }

            if (!
$outOfQuotes) {
                
$buffer .= $char;
                
$noescape '\\' === $char ? !$noescape true;
                continue;
            }
            if (
'' !== $buffer) {
                if (
$unescapeSlashes) {
                    
$buffer str_replace('\\/''/'$buffer);
                }

                if (
$unescapeUnicode && function_exists('mb_convert_encoding')) {
                    
// https://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha
                    
$buffer preg_replace_callback('/(\\\\+)u([0-9a-f]{4})/i', function ($match) {
                        
$l strlen($match[1]);

                        if (
$l 2) {
                            
$code hexdec($match[2]);
                            
// 0xD800..0xDFFF denotes UTF-16 surrogate pair which won't be unescaped
                            // see https://github.com/composer/composer/issues/7510
                            
if (0xD800 <= $code && 0xDFFF >= $code) {
                                return 
$match[0];
                            }

                            return 
str_repeat('\\'$l 1) . mb_convert_encoding(
                                
pack('H*'$match[2]),
                                
'UTF-8',
                                
'UCS-2BE'
                            
);
                        }

                        return 
$match[0];
                    }, 
$buffer);
                }

                
$result .= $buffer.$char;
                
$buffer '';
                continue;
            }

            if (
':' === $char) {
                
// Add a space after the : character
                
$char .= ' ';
            } elseif (
'}' === $char || ']' === $char) {
                
$pos--;
                
$prevChar substr($json$i 11);

                if (
'{' !== $prevChar && '[' !== $prevChar) {
                    
// If this character is the end of an element,
                    // output a new line and indent the next line
                    
$result .= $newLine;
                    for (
$j 0$j $pos$j++) {
                        
$result .= $indentStr;
                    }
                } else {
                    
// Collapse empty {} and []
                    
$result rtrim($result);
                }
            }

            
$result .= $char;

            
// If the last character was the beginning of an element,
            // output a new line and indent the next line
            
if (',' === $char || '{' === $char || '[' === $char) {
                
$result .= $newLine;

                if (
'{' === $char || '[' === $char) {
                    
$pos++;
                }

                for (
$j 0$j $pos$j++) {
                    
$result .= $indentStr;
                }
            }
        }

        return 
$result;
    }
}

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