wordpress/wp-content/plugins/kt-tinymce-color-grid/index.php
/**
         * Import settings from file upload
         * @since 1.8
         * @return string
         */
Import settings from file upload
@since 1.8
@return string
Import settings from file upload @since 1 . 8 @return string
protected function import_backup() {
            if (isset($_FILES['kt_upload'])) {
                $file = $_FILES['kt_upload'];
                $status = $this->verify_upload($file);
                if ($status != 'ok') {
                    return $status;
                }
                $payload = file_get_contents($file['tmp_name']);
            } else if (isset($_REQUEST['kt_raw_upload'])) {
                $payload = $_REQUEST['kt_raw_upload'];
            } else {
                return 'no-import';
            }
            $options = null;
            if ($this->import_is_json($payload)) {
                $options = json_decode($payload, true);
            } else if ($this->import_is_base64($payload)) {
                $payload = base64_decode(substr($payload, 0, -8));
                $options = json_decode($payload, true);
            } else {
                return 'format';
            }
            if (!is_array($options)) {
                return 'funny';
            }
            if (!isset($options[self::ACTIVE_VERSION])) {
                $options[self::ACTIVE_VERSION] = 180;
            }
            $this->update_import($options);
            $options[self::PALETTE] = $this->merge_palette($options[self::PALETTE]);
            $names = array_keys($this->default_options());
            foreach ($names as $name) {
                if (isset($options[$name])) {
                    $this->set_option($name, $options[$name]);
                }
            }
            return 'ok';
        }
protected function import_backup ( ) { if ( isset ( $ _FILES [ 'kt_upload' ] ) ) { $ file = $ _FILES [ 'kt_upload' ] ; $ status = $ this -> verify_upload ( $ file ) ; if ( $ status != 'ok' ) { return $ status ; } $ payload = file_get_contents ( $ file [ 'tmp_name' ] ) ; } else if ( isset ( $ _REQUEST [ 'kt_raw_upload' ] ) ) { $ payload = $ _REQUEST [ 'kt_raw_upload' ] ; } else { return 'no-import' ; } $ options = null ; if ( $ this -> import_is_json ( $ payload ) ) { $ options = json_decode ( $ payload , true ) ; } else if ( $ this -> import_is_base64 ( $ payload ) ) { $ payload = base64_decode ( substr ( $ payload , 0 , - 8 ) ) ; $ options = json_decode ( $ payload , true ) ; } else { return 'format' ; } if ( ! is_array ( $ options ) ) { return 'funny' ; } if ( ! isset ( $ options [ self :: ACTIVE_VERSION ] ) ) { $ options [ self :: ACTIVE_VERSION ] = 180 ; } $ this -> update_import ( $ options ) ; $ options [ self :: PALETTE ] = $ this -> merge_palette ( $ options [ self :: PALETTE ] ) ; $ names = array_keys ( $ this -> default_options ( ) ) ; foreach ( $ names as $ name ) { if ( isset ( $ options [ $ name ] ) ) { $ this -> set_option ( $ name , $ options [ $ name ] ) ; } } return 'ok' ; }
Import settings from file upload
 @since 1.8
 @return string
Import settings from file upload @since 1 . 8 @return string