!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/tests/Decoda/Hook/   drwxrwxr-x
Free 15.58 GB of 61.93 GB (25.16%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     CensorHookTest.php (2.78 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\Hook\CensorHook;
use 
Decoda\Test\TestCase;

class 
CensorHookTest extends TestCase {

    protected 
$equivalentChars '@#$*!?%';

    
/**
     * Set up Decoda.
     */
    
protected function setUp() {
        
parent::setUp();

        
$this->object = new CensorHook();
        
$this->object->setParser(new Decoda());
        
$this->object->startup();
    }

    
/**
     * Test that beforeParse() will convert curse words to a censored equivalent. Will also take into account mulitple characters.
     */
    
public function testParse() {
        
$this->assertRegExp(sprintf('/%s/'$this->getCensoredRegex(4)), $this->object->beforeParse('fuck'));
        
$this->assertRegExp(sprintf('/%s/'$this->getCensoredRegex(12)), $this->object->beforeParse('fuuuccckkkkk'));
        
$this->assertRegExp(sprintf('/%s/'$this->getCensoredRegex(14)), $this->object->beforeParse('fffUUUcccKKKkk'));
        
$this->assertRegExp(sprintf('/%s %s %s/'$this->getCensoredRegex(4), $this->getCensoredRegex(5), $this->getCensoredRegex(6)), $this->object->beforeParse('fuck fuckk fucckk'));
        
$this->assertRegExp(sprintf('/Hey, %s you buddy!/'$this->getCensoredRegex(4)), $this->object->beforeParse('Hey, fuck you buddy!'));

        
// Don't censor words that share a blacklist
        
$this->assertRegExp(sprintf('/%s/'$this->getCensoredRegex(3)), $this->object->beforeParse('nig'));
        
$this->assertRegExp(sprintf('/%s/'$this->getCensoredRegex(6)), $this->object->beforeParse('nigger'));
        
$this->assertEquals('Night'$this->object->beforeParse('Night'));
    }

    
/**
     * Test that blacklist() censors words on the fly.
     */
    
public function testBlacklist() {
        
$this->assertEquals('word'$this->object->beforeParse('word'));

        
$this->object->blacklist(array('word'));
        
$this->assertRegExp(sprintf('/%s/'$this->getCensoredRegex(4)), $this->object->beforeParse('word'));
        
$this->assertRegExp(sprintf('/%s/'$this->getCensoredRegex(9)), $this->object->beforeParse('wooRrrDdd'));
    }

    
/**
     * Gets the censored equivalent regex with the specified length
     *
     * @param integer $length The number of characters for the equivalent regex
     * @return string The censored equivalent regex with a maximum of 10 letters
     */
    
protected function getCensoredRegex($length)
    {
        
// The string censored equivalent is limited to 10 letters
        
if (10 $length) {
            
$length 10;
        }

        
$regex sprintf('[%s]{%d}'preg_quote($this->equivalentChars'/'), $length);

        return 
$regex;
    }

}

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