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:
parent
bdb78a186a
commit
91d69898df
@ -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()
|
||||
{
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user