mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 04:10:38 +02:00
Fix for e_form::name2id() when = and ? characters are detected is found.
This commit is contained in:
@@ -3926,7 +3926,7 @@ var_dump($select_options);*/
|
|||||||
function name2id($name)
|
function name2id($name)
|
||||||
{
|
{
|
||||||
$name = strtolower($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()
|
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()
|
public function testFormat_options()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user