!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/usr/share/phpMyAdmin/test/libraries/common/   drwxr-xr-x
Free 8.9 GB of 93.48 GB (9.52%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     PMA_quoting_slashing_test.php (5.74 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Test for quoting, slashing/backslashing
 *
 * @package PhpMyAdmin-test
 * @group common.lib-tests
 */

/*
 * Include to test.
 */
require_once 'libraries/Util.class.php';
require_once 
'libraries/sqlparser.data.php';

/**
 * Test for quoting, slashing/backslashing
 *
 * @package PhpMyAdmin-test
 * @group common.lib-tests
 */
class PMA_QuotingSlashing_Test extends PHPUnit_Framework_TestCase
{

    
/**
     * sqlAddslashes test
     *
     * @return void
     */
    
public function testAddSlashes()
    {
        
$string "\'test''\''\'\r\t\n";

        
$this->assertEquals(
            
"\\\\\\\\\'test\'\'\\\\\\\\\'\'\\\\\\\\\'\\r\\t\\n",
            
PMA_Util::sqlAddSlashes($stringtruetruetrue)
        );
        
$this->assertEquals(
            
"\\\\\\\\''test''''\\\\\\\\''''\\\\\\\\''\\r\\t\\n",
            
PMA_Util::sqlAddSlashes($stringtruetruefalse)
        );
        
$this->assertEquals(
            
"\\\\\\\\\'test\'\'\\\\\\\\\'\'\\\\\\\\\'\r\t\n",
            
PMA_Util::sqlAddSlashes($stringtruefalsetrue)
        );
        
$this->assertEquals(
            
"\\\\\\\\''test''''\\\\\\\\''''\\\\\\\\''\r\t\n",
            
PMA_Util::sqlAddSlashes($stringtruefalsefalse)
        );
        
$this->assertEquals(
            
"\\\\\'test\'\'\\\\\'\'\\\\\'\\r\\t\\n",
            
PMA_Util::sqlAddSlashes($stringfalsetruetrue)
        );
        
$this->assertEquals(
            
"\\\\''test''''\\\\''''\\\\''\\r\\t\\n",
            
PMA_Util::sqlAddSlashes($stringfalsetruefalse)
        );
        
$this->assertEquals(
            
"\\\\\'test\'\'\\\\\'\'\\\\\'\r\t\n",
            
PMA_Util::sqlAddSlashes($stringfalsefalsetrue)
        );
        
$this->assertEquals(
            
"\\\\''test''''\\\\''''\\\\''\r\t\n",
            
PMA_Util::sqlAddSlashes($stringfalsefalsefalse)
        );
    }

    
/**
     * data provider for PMA_Util::unQuote test
     *
     * @return array
     */
    
public function unQuoteProvider()
    {
        return array(
            array(
'"test\'"'"test'"),
            array(
"'test''""test'"),
            array(
"`test'`""test'"),
            array(
"'test'test""'test'test")
        );
    }

    
/**
     * PMA_Util::unQuote test
     *
     * @param string $param    String
     * @param string $expected Expected output
     *
     * @return void
     *
     * @dataProvider unQuoteProvider
     */
    
public function testUnQuote($param$expected)
    {
        
$this->assertEquals(
            
$expectedPMA_Util::unQuote($param)
        );
    }

    
/**
     * data provider for PMA_Util::unQuote test with chosen quote
     *
     * @return array
     */
    
public function unQuoteSelectedProvider()
    {
        return array(
            array(
'"test\'"'"test'"),
            array(
"'test''""'test''"),
            array(
"`test'`""`test'`"),
            array(
"'test'test""'test'test")
        );
    }

    
/**
     * PMA_Util::unQuote test with chosen quote
     *
     * @param string $param    String
     * @param string $expected Expected output
     *
     * @return void
     *
     * @dataProvider unQuoteSelectedProvider
     */
    
public function testUnQuoteSelectedChar($param$expected)
    {
        
$this->assertEquals(
            
$expectedPMA_Util::unQuote($param'"')
        );
    }

    
/**
     * data provider for backquote test
     *
     * @return array
     */
    
public function backquoteDataProvider()
    {
        return array(
            array(
'0''`0`'),
            array(
'test''`test`'),
            array(
'te`st''`te``st`'),
            array(
                array(
'test''te`st''''*'),
                array(
'`test`''`te``st`''''*')
            )
        );
    }

    
/**
     * backquote test with different param $do_it (true, false)
     *
     * @param string $a String
     * @param string $b Expected output
     *
     * @return void
     *
     * @dataProvider backquoteDataProvider
     */
    
public function testBackquote($a$b)
    {
        
// Test bypass quoting (used by dump functions)
        
$this->assertEquals($aPMA_Util::backquote($afalse));

        
// Test backquote
        
$this->assertEquals($bPMA_Util::backquote($a));
    }

    
/**
     * data provider for backquoteCompat test
     *
     * @return array
     */
    
public function backquoteCompatDataProvider()
    {
        return array(
            array(
'0''"0"'),
            array(
'test''"test"'),
            array(
'te`st''"te`st"'),
            array(
                array(
'test''te`st''''*'),
                array(
'"test"''"te`st"''''*')
            )
        );
    }

    
/**
     * backquoteCompat test with different param $compatibility (NONE, MSSQL)
     *
     * @param string $a String
     * @param string $b Expected output
     *
     * @return void
     *
     * @dataProvider backquoteCompatDataProvider
     */
    
public function testbackquoteCompat($a$b)
    {
        
// Test bypass quoting (used by dump functions)
        
$this->assertEquals($aPMA_Util::backquoteCompat($a'NONE'false));

        
// Run tests in MSSQL compatibility mode
        // Test bypass quoting (used by dump functions)
        
$this->assertEquals($aPMA_Util::backquoteCompat($a'MSSQL'false));

        
// Test backquote
        
$this->assertEquals($bPMA_Util::backquoteCompat($a'MSSQL'));
    }

    
/**
     * backquoteCompat test with forbidden words
     *
     * @return void
     */
    
public function testBackquoteForbidenWords()
    {
        global 
$PMA_SQPdata_forbidden_word;

        foreach (
$PMA_SQPdata_forbidden_word as $forbidden) {
            
$this->assertEquals(
                
"`" $forbidden "`",
                
PMA_Util::backquote($forbiddenfalse)
            );
        }
    }
}
?>

:: 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 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0047 ]--