Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.216.95.250
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
wb /
vendor /
symfony /
form /
Delete
Unzip
Name
Size
Permission
Date
Action
ChoiceList
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Command
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Console
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
DependencyInjection
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Event
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Exception
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Extension
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Guess
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Resources
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Test
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
Util
[ DIR ]
drwxrwxr-x
2022-07-20 13:00
AbstractExtension.php
4.59
KB
-rw-rw-r--
2022-07-20 13:00
AbstractRendererEngine.php
7
KB
-rw-rw-r--
2022-07-20 13:00
AbstractType.php
1.29
KB
-rw-rw-r--
2022-07-20 13:00
AbstractTypeExtension.php
974
B
-rw-rw-r--
2022-07-20 13:00
Button.php
8.55
KB
-rw-rw-r--
2022-07-20 13:00
ButtonBuilder.php
14.89
KB
-rw-rw-r--
2022-07-20 13:00
ButtonTypeInterface.php
462
B
-rw-rw-r--
2022-07-20 13:00
CHANGELOG.md
29.84
KB
-rw-rw-r--
2022-07-20 13:00
CallbackTransformer.php
1012
B
-rw-rw-r--
2022-07-20 13:00
ClearableErrorsInterface.php
640
B
-rw-rw-r--
2022-07-20 13:00
ClickableInterface.php
522
B
-rw-rw-r--
2022-07-20 13:00
DataAccessorInterface.php
2.26
KB
-rw-rw-r--
2022-07-20 13:00
DataMapperInterface.php
2.37
KB
-rw-rw-r--
2022-07-20 13:00
DataTransformerInterface.php
3.71
KB
-rw-rw-r--
2022-07-20 13:00
FileUploadError.php
338
B
-rw-rw-r--
2022-07-20 13:00
Form.php
37.92
KB
-rw-rw-r--
2022-07-20 13:00
FormBuilder.php
7.22
KB
-rw-rw-r--
2022-07-20 13:00
FormBuilderInterface.php
2.02
KB
-rw-rw-r--
2022-07-20 13:00
FormConfigBuilder.php
18.98
KB
-rw-rw-r--
2022-07-20 13:00
FormConfigBuilderInterface.php
6.89
KB
-rw-rw-r--
2022-07-20 13:00
FormConfigInterface.php
5.83
KB
-rw-rw-r--
2022-07-20 13:00
FormError.php
3.24
KB
-rw-rw-r--
2022-07-20 13:00
FormErrorIterator.php
8.14
KB
-rw-rw-r--
2022-07-20 13:00
FormEvent.php
1.12
KB
-rw-rw-r--
2022-07-20 13:00
FormEvents.php
4.02
KB
-rw-rw-r--
2022-07-20 13:00
FormExtensionInterface.php
1.48
KB
-rw-rw-r--
2022-07-20 13:00
FormFactory.php
3.85
KB
-rw-rw-r--
2022-07-20 13:00
FormFactoryBuilder.php
4.12
KB
-rw-rw-r--
2022-07-20 13:00
FormFactoryBuilderInterface.php
2.3
KB
-rw-rw-r--
2022-07-20 13:00
FormFactoryInterface.php
3.15
KB
-rw-rw-r--
2022-07-20 13:00
FormInterface.php
9.58
KB
-rw-rw-r--
2022-07-20 13:00
FormRegistry.php
4.7
KB
-rw-rw-r--
2022-07-20 13:00
FormRegistryInterface.php
1.19
KB
-rw-rw-r--
2022-07-20 13:00
FormRenderer.php
11.88
KB
-rw-rw-r--
2022-07-20 13:00
FormRendererEngineInterface.php
6.08
KB
-rw-rw-r--
2022-07-20 13:00
FormRendererInterface.php
3.07
KB
-rw-rw-r--
2022-07-20 13:00
FormTypeExtensionInterface.php
1.45
KB
-rw-rw-r--
2022-07-20 13:00
FormTypeGuesserChain.php
2.76
KB
-rw-rw-r--
2022-07-20 13:00
FormTypeGuesserInterface.php
1.49
KB
-rw-rw-r--
2022-07-20 13:00
FormTypeInterface.php
2.65
KB
-rw-rw-r--
2022-07-20 13:00
FormView.php
3.75
KB
-rw-rw-r--
2022-07-20 13:00
Forms.php
2.73
KB
-rw-rw-r--
2022-07-20 13:00
LICENSE
1.04
KB
-rw-rw-r--
2022-07-20 13:00
NativeRequestHandler.php
7.53
KB
-rw-rw-r--
2022-07-20 13:00
PreloadedExtension.php
2.06
KB
-rw-rw-r--
2022-07-20 13:00
README.md
483
B
-rw-rw-r--
2022-07-20 13:00
RequestHandlerInterface.php
796
B
-rw-rw-r--
2022-07-20 13:00
ResolvedFormType.php
5.74
KB
-rw-rw-r--
2022-07-20 13:00
ResolvedFormTypeFactory.php
658
B
-rw-rw-r--
2022-07-20 13:00
ResolvedFormTypeFactoryInterface.php
1.17
KB
-rw-rw-r--
2022-07-20 13:00
ResolvedFormTypeInterface.php
2.21
KB
-rw-rw-r--
2022-07-20 13:00
ReversedTransformer.php
1.03
KB
-rw-rw-r--
2022-07-20 13:00
SubmitButton.php
1.18
KB
-rw-rw-r--
2022-07-20 13:00
SubmitButtonBuilder.php
613
B
-rw-rw-r--
2022-07-20 13:00
SubmitButtonTypeInterface.php
474
B
-rw-rw-r--
2022-07-20 13:00
composer.json
2.41
KB
-rw-rw-r--
2022-07-20 13:00
Save
Rename
<?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\BadMethodCallException; use Symfony\Component\Form\Exception\LogicException; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; use Twig\Environment; /** * Renders a form into HTML using a rendering engine. * * @author Bernhard Schussek <bschussek@gmail.com> */ class FormRenderer implements FormRendererInterface { public const CACHE_KEY_VAR = 'unique_block_prefix'; private $engine; private $csrfTokenManager; private $blockNameHierarchyMap = []; private $hierarchyLevelMap = []; private $variableStack = []; public function __construct(FormRendererEngineInterface $engine, CsrfTokenManagerInterface $csrfTokenManager = null) { $this->engine = $engine; $this->csrfTokenManager = $csrfTokenManager; } /** * {@inheritdoc} */ public function getEngine() { return $this->engine; } /** * {@inheritdoc} */ public function setTheme(FormView $view, $themes, bool $useDefaultThemes = true) { $this->engine->setTheme($view, $themes, $useDefaultThemes); } /** * {@inheritdoc} */ public function renderCsrfToken(string $tokenId) { if (null === $this->csrfTokenManager) { throw new BadMethodCallException('CSRF tokens can only be generated if a CsrfTokenManagerInterface is injected in FormRenderer::__construct(). Try running "composer require symfony/security-csrf".'); } return $this->csrfTokenManager->getToken($tokenId)->getValue(); } /** * {@inheritdoc} */ public function renderBlock(FormView $view, string $blockName, array $variables = []) { $resource = $this->engine->getResourceForBlockName($view, $blockName); if (!$resource) { throw new LogicException(sprintf('No block "%s" found while rendering the form.', $blockName)); } $viewCacheKey = $view->vars[self::CACHE_KEY_VAR]; // The variables are cached globally for a view (instead of for the // current suffix) if (!isset($this->variableStack[$viewCacheKey])) { $this->variableStack[$viewCacheKey] = []; // The default variable scope contains all view variables, merged with // the variables passed explicitly to the helper $scopeVariables = $view->vars; $varInit = true; } else { // Reuse the current scope and merge it with the explicitly passed variables $scopeVariables = end($this->variableStack[$viewCacheKey]); $varInit = false; } // Merge the passed with the existing attributes if (isset($variables['attr']) && isset($scopeVariables['attr'])) { $variables['attr'] = array_replace($scopeVariables['attr'], $variables['attr']); } // Merge the passed with the exist *label* attributes if (isset($variables['label_attr']) && isset($scopeVariables['label_attr'])) { $variables['label_attr'] = array_replace($scopeVariables['label_attr'], $variables['label_attr']); } // Do not use array_replace_recursive(), otherwise array variables // cannot be overwritten $variables = array_replace($scopeVariables, $variables); $this->variableStack[$viewCacheKey][] = $variables; // Do the rendering $html = $this->engine->renderBlock($view, $resource, $blockName, $variables); // Clear the stack array_pop($this->variableStack[$viewCacheKey]); if ($varInit) { unset($this->variableStack[$viewCacheKey]); } return $html; } /** * {@inheritdoc} */ public function searchAndRenderBlock(FormView $view, string $blockNameSuffix, array $variables = []) { $renderOnlyOnce = 'row' === $blockNameSuffix || 'widget' === $blockNameSuffix; if ($renderOnlyOnce && $view->isRendered()) { // This is not allowed, because it would result in rendering same IDs multiple times, which is not valid. throw new BadMethodCallException(sprintf('Field "%s" has already been rendered, save the result of previous render call to a variable and output that instead.', $view->vars['name'])); } // The cache key for storing the variables and types $viewCacheKey = $view->vars[self::CACHE_KEY_VAR]; $viewAndSuffixCacheKey = $viewCacheKey.$blockNameSuffix; // In templates, we have to deal with two kinds of block hierarchies: // // +---------+ +---------+ // | Theme B | -------> | Theme A | // +---------+ +---------+ // // form_widget -------> form_widget // ^ // | // choice_widget -----> choice_widget // // The first kind of hierarchy is the theme hierarchy. This allows to // override the block "choice_widget" from Theme A in the extending // Theme B. This kind of inheritance needs to be supported by the // template engine and, for example, offers "parent()" or similar // functions to fall back from the custom to the parent implementation. // // The second kind of hierarchy is the form type hierarchy. This allows // to implement a custom "choice_widget" block (no matter in which theme), // or to fallback to the block of the parent type, which would be // "form_widget" in this example (again, no matter in which theme). // If the designer wants to explicitly fallback to "form_widget" in their // custom "choice_widget", for example because they only want to wrap // a <div> around the original implementation, they can call the // widget() function again to render the block for the parent type. // // The second kind is implemented in the following blocks. if (!isset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey])) { // INITIAL CALL // Calculate the hierarchy of template blocks and start on // the bottom level of the hierarchy (= "_<id>_<section>" block) $blockNameHierarchy = []; foreach ($view->vars['block_prefixes'] as $blockNamePrefix) { $blockNameHierarchy[] = $blockNamePrefix.'_'.$blockNameSuffix; } $hierarchyLevel = \count($blockNameHierarchy) - 1; $hierarchyInit = true; } else { // RECURSIVE CALL // If a block recursively calls searchAndRenderBlock() again, resume rendering // using the parent type in the hierarchy. $blockNameHierarchy = $this->blockNameHierarchyMap[$viewAndSuffixCacheKey]; $hierarchyLevel = $this->hierarchyLevelMap[$viewAndSuffixCacheKey] - 1; $hierarchyInit = false; } // The variables are cached globally for a view (instead of for the // current suffix) if (!isset($this->variableStack[$viewCacheKey])) { $this->variableStack[$viewCacheKey] = []; // The default variable scope contains all view variables, merged with // the variables passed explicitly to the helper $scopeVariables = $view->vars; $varInit = true; } else { // Reuse the current scope and merge it with the explicitly passed variables $scopeVariables = end($this->variableStack[$viewCacheKey]); $varInit = false; } // Load the resource where this block can be found $resource = $this->engine->getResourceForBlockNameHierarchy($view, $blockNameHierarchy, $hierarchyLevel); // Update the current hierarchy level to the one at which the resource was // found. For example, if looking for "choice_widget", but only a resource // is found for its parent "form_widget", then the level is updated here // to the parent level. $hierarchyLevel = $this->engine->getResourceHierarchyLevel($view, $blockNameHierarchy, $hierarchyLevel); // The actually existing block name in $resource $blockName = $blockNameHierarchy[$hierarchyLevel]; // Escape if no resource exists for this block if (!$resource) { if (\count($blockNameHierarchy) !== \count(array_unique($blockNameHierarchy))) { throw new LogicException(sprintf('Unable to render the form because the block names array contains duplicates: "%s".', implode('", "', array_reverse($blockNameHierarchy)))); } throw new LogicException(sprintf('Unable to render the form as none of the following blocks exist: "%s".', implode('", "', array_reverse($blockNameHierarchy)))); } // Merge the passed with the existing attributes if (isset($variables['attr']) && isset($scopeVariables['attr'])) { $variables['attr'] = array_replace($scopeVariables['attr'], $variables['attr']); } // Merge the passed with the exist *label* attributes if (isset($variables['label_attr']) && isset($scopeVariables['label_attr'])) { $variables['label_attr'] = array_replace($scopeVariables['label_attr'], $variables['label_attr']); } // Do not use array_replace_recursive(), otherwise array variables // cannot be overwritten $variables = array_replace($scopeVariables, $variables); // In order to make recursive calls possible, we need to store the block hierarchy, // the current level of the hierarchy and the variables so that this method can // resume rendering one level higher of the hierarchy when it is called recursively. // // We need to store these values in maps (associative arrays) because within a // call to widget() another call to widget() can be made, but for a different view // object. These nested calls should not override each other. $this->blockNameHierarchyMap[$viewAndSuffixCacheKey] = $blockNameHierarchy; $this->hierarchyLevelMap[$viewAndSuffixCacheKey] = $hierarchyLevel; // We also need to store the variables for the view so that we can render other // blocks for the same view using the same variables as in the outer block. $this->variableStack[$viewCacheKey][] = $variables; // Do the rendering $html = $this->engine->renderBlock($view, $resource, $blockName, $variables); // Clear the stack array_pop($this->variableStack[$viewCacheKey]); // Clear the caches if they were filled for the first time within // this function call if ($hierarchyInit) { unset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey], $this->hierarchyLevelMap[$viewAndSuffixCacheKey]); } if ($varInit) { unset($this->variableStack[$viewCacheKey]); } if ($renderOnlyOnce) { $view->setRendered(); } return $html; } /** * {@inheritdoc} */ public function humanize(string $text) { return ucfirst(strtolower(trim(preg_replace(['/([A-Z])/', '/[_\s]+/'], ['_$1', ' '], $text)))); } /** * @internal */ public function encodeCurrency(Environment $environment, string $text, string $widget = ''): string { if ('UTF-8' === $charset = $environment->getCharset()) { $text = htmlspecialchars($text, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8'); } else { $text = htmlentities($text, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8'); $text = iconv('UTF-8', $charset, $text); $widget = iconv('UTF-8', $charset, $widget); } return str_replace('{{ widget }}', $widget, $text); } }