403Webshell
Server IP : 89.39.208.18  /  Your IP : 216.73.217.74
Web Server : LiteSpeed
System :
User :  ( )
PHP Version : 7.4.33
Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home3/././mahyarcake/././www/wp-content/plugins/duplicator-pro/classes/ui/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home3/././mahyarcake/././www/wp-content/plugins/duplicator-pro/classes/ui/class.ui.viewstate.php
<?php

defined("ABSPATH") or die("");
/**
 * Gets the view state of UI elements to remember its viewable state
 *
 * Standard: PSR-2
 *
 * @link http://www.php-fig.org/psr/psr-2
 *
 * @package    DUP_PRO
 * @subpackage classes/ui
 * @copyright  (c) 2017, Snapcreek LLC
 * @license    https://opensource.org/licenses/GPL-3.0 GNU Public License
 * @since      3.3.0
 */
class DUP_PRO_UI_ViewState
{
    /** @var string The key used in the wp_options table */
    private static $optionsTableKey = 'duplicator_pro_ui_view_state';

    /**
     * Save the view state of UI elements
     *
     * @param string $key   A unique key to define the UI element
     * @param string $value A generic value to use for the view state
     *
     * @return bool Returns true if the value was successfully saved
     */
    public static function save($key, $value)
    {
        $view_state       = array();
        $view_state       = get_option(self::$optionsTableKey);
        $view_state[$key] = $value;
        $success          = update_option(self::$optionsTableKey, $view_state);
        return $success;
    }

    /**
     * Saves the state of a UI element via post params
     *
     * @return void
     *
     * <code>
     * //JavaScript Ajax Request
     * DupPro.UI.SaveViewStateByPost('dup-pack-archive-panel', 1);
     *
     * //Call PHP Code
     * $view_state       = DUP_PRO_UI_ViewState::getValue('dup-pack-archive-panel');
     * $ui_css_archive   = ($view_state == 1)   ? 'display:block' : 'display:none';
     * </code>
     *
     * @todo: Move this method to a controller see dlite (ctrl)
     */
    public static function saveByPost()
    {
        DUP_PRO_Handler::init_error_handler();
        check_ajax_referer('DUP_PRO_UI_ViewState_SaveByPost', 'nonce');
        $json      = array(
            'update-success' => false,
            'error-message'  => '',
            'key'            => '',
            'value'          => '',
        );
        $isValid   = true;
        $inputData = filter_input_array(INPUT_POST, array(
            'states' => array(
                'filter'  => FILTER_UNSAFE_RAW,
                'flags'   => FILTER_FORCE_ARRAY,
                'options' => array(
                    'default' => array(),
                ),
            ),
            'key'    => array(
                'filter'  => FILTER_SANITIZE_SPECIAL_CHARS,
                'options' => array('default' => false),
            ),
            'value'  => array(
                'filter'  => FILTER_SANITIZE_SPECIAL_CHARS,
                'options' => array('default' => false),
            ),
        ));
        if (isset($inputData['states']) && !empty($inputData['states'])) {
            foreach ($inputData['states'] as $index => $state) {
                $filteredState = filter_var_array($state, array(
                    'key'   => array(
                        'filter'  => FILTER_SANITIZE_SPECIAL_CHARS,
                        'options' => array('default' => false),
                    ),
                    'value' => array(
                        'filter'  => FILTER_SANITIZE_SPECIAL_CHARS,
                        'options' => array('default' => false),
                    ),
                ));
                if ($filteredState['key'] === false && $filteredState['value']) {
                    $isValid = false;
                    break;
                }
                $inputData['states'][$index] = $filteredState;
            }
        }
        if ($inputData['key'] === false || $inputData['value'] === false) {
            $isValid = false;
        }
        // VALIDATIO END

        if ($isValid) {
            if (!empty($inputData['states'])) {
                $view_state = self::getArray();
                $last_key   = '';
                foreach ($inputData['states'] as $state) {
                    $view_state[$state['key']] = $state['value'];
                    $last_key                  = $state['key'];
                }
                $json['update-success'] = self::setArray($view_state);
                $json['key']            = esc_html($last_key);
                $json['value']          = esc_html($view_state[$last_key]);
            } else {
                $json['update-success'] = self::save($inputData['key'], $inputData['value']);
                $json['key']            = esc_html($inputData['key']);
                $json['value']          = esc_html($inputData['value']);
            }
        } else {
            $json['update-success'] = false;
            $json['error-message']  = "Sent data is not valid.";
        }

        die(json_encode($json));
    }

    /**
     *  Gets all the values from the settings array
     *
     *  @return array<string, mixed> Returns and array of all the values stored in the settings array
     */
    public static function getArray()
    {
        return get_option(self::$optionsTableKey);
    }

    /**
     * Gwer view statue value or default if don't exists
     *
     * @param string $key     key
     * @param mixed  $default default value
     *
     * @return mixed
     */
    public static function getValue($key, $default = false)
    {
        $vals = self::getArray();
        return (isset($vals[$key]) ? $vals[$key] : $default);
    }

    /**
     * Sets all the values from the settings array
     *
     * @param array<string, mixed> $view_state states
     *
     * @return boolean Returns whether updated or not
     */
    public static function setArray($view_state)
    {
        return update_option(self::$optionsTableKey, $view_state);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit