403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.145.115.135
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/jenniferflocom/public_html/wp-content/plugins/give/src/Framework/FieldsAPI/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/jenniferflocom/public_html/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