diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-11-08 18:54:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-08 18:54:32 +0100 |
commit | b14d34d2c7b7a7360adcc823472a43f64b579e1c (patch) | |
tree | 3e9cf5757246945a499fdc45d45820021c04e2ce /tests/LinkUtilsTest.php | |
parent | e813f97b1af314e9391e6d4e734dc7cca5b0bc2c (diff) | |
parent | fd08b50a80c3aed25f9e2a19cbfe9fb3ad35cf1f (diff) | |
download | Shaarli-b14d34d2c7b7a7360adcc823472a43f64b579e1c.tar.gz Shaarli-b14d34d2c7b7a7360adcc823472a43f64b579e1c.tar.zst Shaarli-b14d34d2c7b7a7360adcc823472a43f64b579e1c.zip |
Merge pull request #1012 from ArthurHoaro/hotfix/urlencode
Don't URL encode description links if parameter 'redirector.encode_url' is set to false
Diffstat (limited to 'tests/LinkUtilsTest.php')
-rw-r--r-- | tests/LinkUtilsTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/LinkUtilsTest.php b/tests/LinkUtilsTest.php index c77922ec..99679320 100644 --- a/tests/LinkUtilsTest.php +++ b/tests/LinkUtilsTest.php | |||
@@ -131,6 +131,21 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase | |||
131 | } | 131 | } |
132 | 132 | ||
133 | /** | 133 | /** |
134 | * Test text2clickable a redirector set and without URL encode. | ||
135 | */ | ||
136 | public function testText2clickableWithRedirectorDontEncode() | ||
137 | { | ||
138 | $text = 'stuff http://hello.there/?is=someone&or=something#here otherstuff'; | ||
139 | $redirector = 'http://redirector.to'; | ||
140 | $expectedText = 'stuff <a href="'. | ||
141 | $redirector . | ||
142 | 'http://hello.there/?is=someone&or=something#here' . | ||
143 | '">http://hello.there/?is=someone&or=something#here</a> otherstuff'; | ||
144 | $processedText = text2clickable($text, $redirector, false); | ||
145 | $this->assertEquals($expectedText, $processedText); | ||
146 | } | ||
147 | |||
148 | /** | ||
134 | * Test testSpace2nbsp. | 149 | * Test testSpace2nbsp. |
135 | */ | 150 | */ |
136 | public function testSpace2nbsp() | 151 | public function testSpace2nbsp() |