-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RTM] Allow to disable input encoding for a whole dca #708
Changes from all commits
bed0d26
68116ce
fd2ef3f
5098055
31732f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
use Doctrine\DBAL\Types\Type; | ||
use Patchwork\Utf8; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
|
||
/** | ||
|
@@ -83,6 +84,7 @@ | |
* @property string $slabel The submit button label | ||
* @property boolean $preserveTags Preserve HTML tags | ||
* @property boolean $decodeEntities Decode HTML entities | ||
* @property boolean useRawRequestData Use the raw request data from the Symfony request | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jop! Added in 31732f9. |
||
* @property integer $minlength The minimum length | ||
* @property integer $maxlength The maximum length | ||
* @property integer $minval The minimum value | ||
|
@@ -340,6 +342,7 @@ public function __set($strKey, $varValue) | |
case 'trailingSlash': | ||
case 'spaceToUnderscore': | ||
case 'doNotTrim': | ||
case 'useRawRequestData': | ||
$this->arrConfiguration[$strKey] = $varValue ? true : false; | ||
break; | ||
|
||
|
@@ -793,6 +796,13 @@ public function validate() | |
*/ | ||
protected function getPost($strKey) | ||
{ | ||
if ($this->useRawRequestData === true) | ||
{ | ||
/** @var Request $request */ | ||
$request = \System::getContainer()->get('request_stack')->getCurrentRequest(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I think we should use the master request? |
||
return $request->request->get($strKey); | ||
} | ||
|
||
$strMethod = $this->allowHtml ? 'postHtml' : 'post'; | ||
|
||
if ($this->preserveTags) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a behavior change, shouldn't we use
getMasterRequest
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's almost always wrong to take the master request. The use cases are only very, very limited. So no: the current request is the way to go.