SILENT KILLERPanel

Current Path: > > opt > cloudlinux > alt-php55 > root > usr > share > pear > Symfony > Component > Form >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/alt-php55/root/usr/share/pear/Symfony/Component/Form/

NameTypeSizeLast ModifiedActions
Exception Directory - -
Extension Directory - -
Guess Directory - -
Resources Directory - -
Test Directory - -
Util Directory - -
AbstractExtension.php File 4885 bytes December 18 2019 11:24:06.
AbstractRendererEngine.php File 7634 bytes December 18 2019 11:24:06.
AbstractType.php File 1080 bytes December 18 2019 11:24:06.
AbstractTypeExtension.php File 993 bytes December 18 2019 11:24:06.
Button.php File 8826 bytes December 18 2019 11:24:06.
ButtonBuilder.php File 18523 bytes December 18 2019 11:24:06.
ButtonTypeInterface.php File 462 bytes December 18 2019 11:24:06.
CallbackTransformer.php File 2138 bytes December 18 2019 11:24:06.
ClickableInterface.php File 559 bytes December 18 2019 11:24:06.
DataMapperInterface.php File 1130 bytes December 18 2019 11:24:06.
DataTransformerInterface.php File 3159 bytes December 18 2019 11:24:06.
Form.php File 34865 bytes December 18 2019 11:24:06.
FormBuilder.php File 7871 bytes December 18 2019 11:24:06.
FormBuilderInterface.php File 2335 bytes December 18 2019 11:24:06.
FormConfigBuilder.php File 21680 bytes December 18 2019 11:24:06.
FormConfigBuilderInterface.php File 8666 bytes December 18 2019 11:24:06.
FormConfigInterface.php File 6437 bytes December 18 2019 11:24:06.
FormError.php File 2563 bytes December 18 2019 11:24:06.
FormEvent.php File 1247 bytes December 18 2019 11:24:06.
FormEvents.php File 1140 bytes December 18 2019 11:24:06.
FormExtensionInterface.php File 1668 bytes December 18 2019 11:24:06.
FormFactory.php File 5225 bytes December 18 2019 11:24:06.
FormFactoryBuilder.php File 3609 bytes December 18 2019 11:24:06.
FormFactoryBuilderInterface.php File 3058 bytes December 18 2019 11:24:06.
FormFactoryInterface.php File 4244 bytes December 18 2019 11:24:06.
FormInterface.php File 8328 bytes December 18 2019 11:24:06.
FormRegistry.php File 4753 bytes December 18 2019 11:24:06.
FormRegistryInterface.php File 1442 bytes December 18 2019 11:24:06.
FormRenderer.php File 11954 bytes December 18 2019 11:24:06.
FormRendererEngineInterface.php File 7063 bytes December 18 2019 11:24:06.
FormRendererInterface.php File 3279 bytes December 18 2019 11:24:06.
FormTypeExtensionInterface.php File 2125 bytes December 18 2019 11:24:06.
FormTypeGuesserChain.php File 2880 bytes December 18 2019 11:24:06.
FormTypeGuesserInterface.php File 2170 bytes December 18 2019 11:24:06.
FormTypeInterface.php File 3222 bytes December 18 2019 11:24:06.
FormView.php File 3524 bytes December 18 2019 11:24:06.
Forms.php File 5899 bytes December 18 2019 11:24:06.
NativeRequestHandler.php File 5612 bytes December 18 2019 11:24:06.
PreloadedExtension.php File 2317 bytes December 18 2019 11:24:06.
RequestHandlerInterface.php File 668 bytes December 18 2019 11:24:06.
ResolvedFormType.php File 7662 bytes December 18 2019 11:24:06.
ResolvedFormTypeFactory.php File 658 bytes December 18 2019 11:24:06.
ResolvedFormTypeFactoryInterface.php File 1302 bytes December 18 2019 11:24:06.
ResolvedFormTypeInterface.php File 3307 bytes December 18 2019 11:24:06.
ReversedTransformer.php File 1256 bytes December 18 2019 11:24:06.
SubmitButton.php File 1137 bytes December 18 2019 11:24:06.
SubmitButtonBuilder.php File 624 bytes December 18 2019 11:24:06.
SubmitButtonTypeInterface.php File 474 bytes December 18 2019 11:24:06.
autoloader.php File 334 bytes December 18 2019 11:24:06.

Reading File: //opt/cloudlinux/alt-php55/root/usr/share/pear/Symfony/Component/Form//NativeRequestHandler.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Form;

use Symfony\Component\Form\Exception\UnexpectedTypeException;

/**
 * A request handler using PHP's super globals $_GET, $_POST and $_SERVER.
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class NativeRequestHandler implements RequestHandlerInterface
{
    /**
     * The allowed keys of the $_FILES array.
     *
     * @var array
     */
    private static $fileKeys = array(
        'error',
        'name',
        'size',
        'tmp_name',
        'type',
    );

    /**
     * {@inheritdoc}
     */
    public function handleRequest(FormInterface $form, $request = null)
    {
        if (null !== $request) {
            throw new UnexpectedTypeException($request, 'null');
        }

        $name = $form->getName();
        $method = $form->getConfig()->getMethod();

        if ($method !== self::getRequestMethod()) {
            return;
        }

        if ('GET' === $method) {
            if ('' === $name) {
                $data = $_GET;
            } else {
                // Don't submit GET requests if the form's name does not exist
                // in the request
                if (!isset($_GET[$name])) {
                    return;
                }

                $data = $_GET[$name];
            }
        } else {
            $fixedFiles = array();
            foreach ($_FILES as $name => $file) {
                $fixedFiles[$name] = self::stripEmptyFiles(self::fixPhpFilesArray($file));
            }

            if ('' === $name) {
                $params = $_POST;
                $files = $fixedFiles;
            } elseif (array_key_exists($name, $_POST) || array_key_exists($name, $fixedFiles)) {
                $default = $form->getConfig()->getCompound() ? array() : null;
                $params = array_key_exists($name, $_POST) ? $_POST[$name] : $default;
                $files = array_key_exists($name, $fixedFiles) ? $fixedFiles[$name] : $default;
            } else {
                // Don't submit the form if it is not present in the request
                return;
            }

            if (is_array($params) && is_array($files)) {
                $data = array_replace_recursive($params, $files);
            } else {
                $data = $params ?: $files;
            }
        }

        // Don't auto-submit the form unless at least one field is present.
        if ('' === $name && count(array_intersect_key($data, $form->all())) <= 0) {
            return;
        }

        $form->submit($data, 'PATCH' !== $method);
    }

    /**
     * Returns the method used to submit the request to the server.
     *
     * @return string The request method.
     */
    private static function getRequestMethod()
    {
        $method = isset($_SERVER['REQUEST_METHOD'])
            ? strtoupper($_SERVER['REQUEST_METHOD'])
            : 'GET';

        if ('POST' === $method && isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
            $method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
        }

        return $method;
    }

    /**
     * Fixes a malformed PHP $_FILES array.
     *
     * PHP has a bug that the format of the $_FILES array differs, depending on
     * whether the uploaded file fields had normal field names or array-like
     * field names ("normal" vs. "parent[child]").
     *
     * This method fixes the array to look like the "normal" $_FILES array.
     *
     * It's safe to pass an already converted array, in which case this method
     * just returns the original array unmodified.
     *
     * This method is identical to {@link Symfony\Component\HttpFoundation\FileBag::fixPhpFilesArray}
     * and should be kept as such in order to port fixes quickly and easily.
     *
     * @param array $data
     *
     * @return array
     */
    private static function fixPhpFilesArray($data)
    {
        if (!is_array($data)) {
            return $data;
        }

        $keys = array_keys($data);
        sort($keys);

        if (self::$fileKeys !== $keys || !isset($data['name']) || !is_array($data['name'])) {
            return $data;
        }

        $files = $data;
        foreach (self::$fileKeys as $k) {
            unset($files[$k]);
        }

        foreach (array_keys($data['name']) as $key) {
            $files[$key] = self::fixPhpFilesArray(array(
                'error'    => $data['error'][$key],
                'name'     => $data['name'][$key],
                'type'     => $data['type'][$key],
                'tmp_name' => $data['tmp_name'][$key],
                'size'     => $data['size'][$key]
            ));
        }

        return $files;
    }

    /**
     * Sets empty uploaded files to NULL in the given uploaded files array.
     *
     * @param mixed $data The file upload data.
     *
     * @return array|null Returns the stripped upload data.
     */
    private static function stripEmptyFiles($data)
    {
        if (!is_array($data)) {
            return $data;
        }

        $keys = array_keys($data);
        sort($keys);

        if (self::$fileKeys === $keys) {
            if (UPLOAD_ERR_NO_FILE === $data['error']) {
                return null;
            }

            return $data;
        }

        foreach ($data as $key => $value) {
            $data[$key] = self::stripEmptyFiles($value);
        }

        return $data;
    }
}

SILENT KILLER Tool