protected FormBuilder::buildFormAction()
Builds the $form['#action'].
Return value
string The URL to be used as the $form['#action'].
File
- core/lib/Drupal/Core/Form/FormBuilder.php, line 828
Class
- FormBuilder
- Provides form building and processing.
Namespace
Drupal\Core\Form
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | protected function buildFormAction() { // @todo Use <current> instead of the master request in $request = $this ->requestStack->getMasterRequest(); $request_uri = $request ->getRequestUri(); // Prevent cross site requests via the Form API by using an absolute URL // when the request uri starts with multiple slashes.. if ( strpos ( $request_uri , '//' ) === 0) { $request_uri = $request ->getUri(); } // @todo Remove this parsing once these are removed from the request in $parsed = UrlHelper::parse( $request_uri ); unset( $parsed [ 'query' ][ static ::AJAX_FORM_REQUEST], $parsed [ 'query' ][MainContentViewSubscriber::WRAPPER_FORMAT]); return $parsed [ 'path' ] . ( $parsed [ 'query' ] ? ( '?' . UrlHelper::buildQuery( $parsed [ 'query' ])) : '' ); } |
Please login to continue.