getNormalizedIniPostMaxSize example

 else {
            // Mark the form with an error if the uploaded size was too large             // This is done here and not in FormValidator because $_POST is             // empty when that error occurs. Hence the form is never submitted.             if ($this->serverParams->hasPostMaxSizeBeenExceeded()) {
                // Submit the form, but don't clear the default values                 $form->submit(null, false);

                $form->addError(new FormError(
                    $form->getConfig()->getOption('upload_max_size_message')(),
                    null,
                    ['{{ max }}' => $this->serverParams->getNormalizedIniPostMaxSize()]
                ));

                return;
            }

            $fixedFiles = [];
            foreach ($_FILES as $fileKey => $file) {
                $fixedFiles[$fileKey] = self::stripEmptyFiles(self::fixPhpFilesArray($file));
            }

            if ('' === $name) {
                
return $maxContentLength && $contentLength > $maxContentLength;
    }

    /** * Returns maximum post size in bytes. * * @return int|null The maximum post size in bytes */
    public function getPostMaxSize()
    {
        $iniMax = strtolower($this->getNormalizedIniPostMaxSize());

        if ($iniMax === '') {
            return null;
        }

        $max = ltrim($iniMax, '+');
        if (strpos($max, '0x') === 0) {
            $max = \intval($max, 16);
        } elseif (strpos($max, '0') === 0) {
            $max = \intval($max, 8);
        } else {
            
 else {
            // Mark the form with an error if the uploaded size was too large             // This is done here and not in FormValidator because $_POST is             // empty when that error occurs. Hence the form is never submitted.             if ($this->serverParams->hasPostMaxSizeBeenExceeded()) {
                // Submit the form, but don't clear the default values                 $form->submit(null, false);

                $form->addError(new FormError(
                    $form->getConfig()->getOption('upload_max_size_message')(),
                    null,
                    ['{{ max }}' => $this->serverParams->getNormalizedIniPostMaxSize()]
                ));

                return;
            }

            if ('' === $name) {
                $params = $request->request->all();
                $files = $request->files->all();
            } elseif ($request->request->has($name) || $request->files->has($name)) {
                $default = $form->getConfig()->getCompound() ? [] : null;
                $params = $request->request->all()[$name] ?? $default;
                
$contentLength = $this->getContentLength();
        $maxContentLength = $this->getPostMaxSize();

        return $maxContentLength && $contentLength > $maxContentLength;
    }

    /** * Returns maximum post size in bytes. */
    public function getPostMaxSize(): int|float|null
    {
        $iniMax = strtolower($this->getNormalizedIniPostMaxSize());

        if ('' === $iniMax) {
            return null;
        }

        $max = ltrim($iniMax, '+');
        if (str_starts_with($max, '0x')) {
            $max = \intval($max, 16);
        } elseif (str_starts_with($max, '0')) {
            $max = \intval($max, 8);
        } else {
            
Home | Imprint | This part of the site doesn't use cookies.