Escape config-form's action attribute
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
7dde0d019f
commit
5118acce1d
@ -1,4 +1,4 @@
|
||||
<form method="{{ method }}" action="{{ action|raw }}" class="config-form disableAjax">
|
||||
<form method="{{ method }}" action="{{ action|e('html_attr') }}" class="config-form disableAjax">
|
||||
<input type="hidden" name="tab_hash" value="">
|
||||
{% if has_check_page_refresh %}
|
||||
<input type="hidden" name="check_page_refresh" id="check_page_refresh" value="">
|
||||
|
||||
@ -38,13 +38,13 @@ class FormDisplayTemplateTest extends AbstractTestCase
|
||||
*/
|
||||
public function testDisplayFormTop(): void
|
||||
{
|
||||
$_SERVER['REQUEST_URI'] = 'https://www.phpmyadmin.net';
|
||||
$_SERVER['REQUEST_URI'] = 'https://www.phpmyadmin.net/index.php?key=value&key2=">value2';
|
||||
$GLOBALS['cfg']['ServerDefault'] = '';
|
||||
$result = $this->formDisplayTemplate->displayFormTop(null, 'posted', [1]);
|
||||
|
||||
$this->assertStringContainsString(
|
||||
'<form method="get" action="https://www.phpmyadmin.net" ' .
|
||||
'class="config-form disableAjax">',
|
||||
'<form method="get" action="https://www.phpmyadmin.net/'
|
||||
. 'index.php?key=value&key2=">value2" class="config-form disableAjax">',
|
||||
$result
|
||||
);
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ class PageSettingsTest extends AbstractTestCase
|
||||
'<div id="page_settings_modal">'
|
||||
. '<div class="page_settings">'
|
||||
. '<form method="post" '
|
||||
. 'action="index.php?db=db&server=1&lang=en" '
|
||||
. 'action="index.php?db=db&server=1&lang=en" '
|
||||
. 'class="config-form disableAjax">',
|
||||
$html
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user