mirror of
https://github.com/e107inc/e107.git
synced 2025-07-26 09:20:28 +02:00
#4572: e_form
: No htmlspecialchars()
on "other" attributes
Fixes: #4572 Discussion: https://github.com/e107inc/e107/pull/4554#issuecomment-926113601
This commit is contained in:
@@ -3907,7 +3907,10 @@ var_dump($select_options);*/
|
|||||||
//
|
//
|
||||||
foreach ($options as $option => $optval)
|
foreach ($options as $option => $optval)
|
||||||
{
|
{
|
||||||
$optval = htmlspecialchars(trim((string) $optval), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
if ($option !== 'other')
|
||||||
|
{
|
||||||
|
$optval = htmlspecialchars(trim((string) $optval), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||||
|
}
|
||||||
switch ($option)
|
switch ($option)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -867,6 +867,22 @@ class e_formTest extends \Codeception\Test\Unit
|
|||||||
|
|
||||||
$this->assertSame($expected, $actual);
|
$this->assertSame($expected, $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @link https://github.com/e107inc/e107/issues/4572
|
||||||
|
*/
|
||||||
|
public function testGet_attributesOther()
|
||||||
|
{
|
||||||
|
$options = array(
|
||||||
|
'size' => '300px',
|
||||||
|
'other' => 'v-bind:class="{ active: isActive }"',
|
||||||
|
);
|
||||||
|
|
||||||
|
$actual = $this->_frm->get_attributes($options);
|
||||||
|
$expected = ' size=\'300px\' v-bind:class="{ active: isActive }"';
|
||||||
|
|
||||||
|
$this->assertSame($expected, $actual);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
public function test_format_id()
|
public function test_format_id()
|
||||||
{
|
{
|
||||||
@@ -879,7 +895,7 @@ class e_formTest extends \Codeception\Test\Unit
|
|||||||
$expected = 'something-hello-there-and-test';
|
$expected = 'something-hello-there-and-test';
|
||||||
|
|
||||||
$result = $this->_frm->name2id($text);
|
$result = $this->_frm->name2id($text);
|
||||||
|
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user