Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.142.42.247
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Framework/FieldsAPI/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Framework/FieldsAPI//File.php
<?php

namespace Give\Framework\FieldsAPI;

use Give\Framework\ValidationRules\Rules\AllowedTypes;
use Give\Framework\ValidationRules\Rules\File as FileRule;
use Give\Vendors\StellarWP\Validation\Rules\Max;

/**
 * A file upload field.
 *
 * @since 2.32.0 Updated to use the new Validation File Rule; added description
 * @since 2.12.0
 * @since 2.23.1 Moved default rule values inline since inherited constructor is final.
 */
class File extends Field
{
    use Concerns\AllowMultiple;
    use Concerns\HasEmailTag;
    use Concerns\HasHelpText;
    use Concerns\HasLabel;
    use Concerns\HasDescription;

    const TYPE = 'file';

    protected $allowedMimeTypes = [];

    /**
     * Set the maximum file size.
     *
     * @deprecated use maxUploadSize() instead
     *
     * @param  int  $maxSize
     *
     * @return $this
     */
    public function maxSize($maxSize)
    {
        if ($this->hasRule('max')) {
            /** @var Max $rule */
            $rule = $this->getRule('max');
            $rule->size($maxSize);
        }

        $this->rules("max:$maxSize");

        return $this;
    }

    /**
     * Access the maximum file size.
     *
     * @deprecated use getMaxUploadSize() instead
     */
    public function getMaxSize(): int
    {
        if ( ! $this->hasRule('max')) {
            return wp_max_upload_size();
        }

        return $this->getRule('max')->getSize();
    }

    /**
     * Set the maximum file upload size.
     *
     * @since 2.32.0
     */
    public function maxUploadSize(int $maxUploadSize): File
    {
        if ($this->hasRule(FileRule::id())) {
            /** @var FileRule $rule */
            $rule = $this->getRule(FileRule::id());
            $rule->maxSize($maxUploadSize);
        }

        $this->rules((new FileRule())->maxSize($maxUploadSize));

        return $this;
    }

    /**
     * Access the maximum file upload size.
     *
     * @since 2.32.0
     */
    public function getMaxUploadSize(): int
    {
        if (!$this->hasRule(FileRule::id())) {
            return wp_max_upload_size();
        }

        /** @var FileRule $rule */
        $rule = $this->getRule(FileRule::id());

        return $rule->getMaxSize();
    }

    /**
     * Set the allowed mime types.
     *
     * @since 2.32.0
     *
     * @param  string[]  $allowedMimeTypes
     */
    public function allowedMimeTypes(array $allowedMimeTypes): File
    {
        if ($this->hasRule(FileRule::id())) {
            /** @var FileRule $rule */
            $rule = $this->getRule(FileRule::id());

            $rule->allowedMimeTypes($allowedMimeTypes);
        } else {
            $this->rules((new FileRule())->allowedMimeTypes($allowedMimeTypes));
        }

        $this->allowedMimeTypes = $allowedMimeTypes;

        return $this;
    }

    /**
     * Access the allowed mime types.
     *
     * @return string[]
     */
    public function getAllowedMimeTypes(): array
    {
        if (!$this->hasRule(FileRule::id())) {
            return get_allowed_mime_types();
        }

        /** @var FileRule $rule */
        $rule = $this->getRule(FileRule::id());

        return $rule->getAllowedMimeTypes();
    }

    /**
     * Set the allowed file types.
     *
     * @deprecated use allowedMimeTypes() instead
     *
     * @param  string[]  $allowedTypes
     */
    public function allowedTypes(array $allowedTypes): File
    {
        if ($this->hasRule('allowedTypes')) {
            /** @var AllowedTypes $rule */
            $rule = $this->getRule('allowedTypes');
            $rule->setAllowedtypes($allowedTypes);
        }

        $this->rules('allowedTypes:' . implode(',', $allowedTypes));

        return $this;
    }

    /**
     * Access the allowed file types.
     *
     * @deprecated use getAllowedMimeTypes() instead
     *
     * @return string[]
     */
    public function getAllowedTypes(): array
    {
        if ( ! $this->hasRule('allowedTypes')) {
            return get_allowed_mime_types();
        }

        /** @var AllowedTypes $rule */
        $rule = $this->getRule('allowedTypes');

        return $rule->getAllowedTypes();
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit