1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-22 13:41:52 +02:00

Fix for e_form::name2id() when = and ? characters are detected is found.

This commit is contained in:
Cameron 2020-03-06 17:06:32 -08:00
parent bdb78a186a
commit 91d69898df
2 changed files with 8 additions and 3 deletions
e107_handlers
e107_tests/tests/unit

@ -3926,7 +3926,7 @@ var_dump($select_options);*/
function name2id($name)
{
$name = strtolower($name);
return rtrim(str_replace(array('[]', '[', ']', '_', '/', ' ','.', '(', ')', '::', ':'), array('-', '-', '', '-', '-', '-', '-','','','-',''), $name), '-');
return rtrim(str_replace(array('[]', '[', ']', '_', '/', ' ','.', '(', ')', '::', ':', '?','='), array('-', '-', '', '-', '-', '-', '-','','','-','','-','-'), $name), '-');
}
/**

@ -741,12 +741,17 @@ class e_formTest extends \Codeception\Test\Unit
{
}
*/
public function testName2id()
{
$text = "Something?hello=there and test";
$expected = 'something-hello-there-and-test';
$result = $this->_frm->name2id($text);
$this->assertEquals($expected, $result);
}
/*
public function testFormat_options()
{