Don't URL encode description links if parameter 'redirector.encode_url' is set to false

This commit is contained in:
ArthurHoaro 2017-11-07 20:23:58 +01:00
parent d12b2a08c8
commit fd08b50a80
4 changed files with 40 additions and 10 deletions

View file

@ -130,6 +130,21 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
$this->assertEquals($expectedText, $processedText);
}
/**
* Test text2clickable a redirector set and without URL encode.
*/
public function testText2clickableWithRedirectorDontEncode()
{
$text = 'stuff http://hello.there/?is=someone&or=something#here otherstuff';
$redirector = 'http://redirector.to';
$expectedText = 'stuff <a href="'.
$redirector .
'http://hello.there/?is=someone&or=something#here' .
'">http://hello.there/?is=someone&or=something#here</a> otherstuff';
$processedText = text2clickable($text, $redirector, false);
$this->assertEquals($expectedText, $processedText);
}
/**
* Test testSpace2nbsp.
*/