diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-03-24 19:40:12 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-04-09 16:52:32 +0200 |
commit | 043eae70c4c57b0447b56a58b64ce9d102895396 (patch) | |
tree | 83a40e1f0096059bd9c7c13efbcfdeaa0ea06b5e /tests | |
parent | 9486a2e92911c726673fe50674a0a408be3c774f (diff) | |
download | Shaarli-043eae70c4c57b0447b56a58b64ce9d102895396.tar.gz Shaarli-043eae70c4c57b0447b56a58b64ce9d102895396.tar.zst Shaarli-043eae70c4c57b0447b56a58b64ce9d102895396.zip |
Fixes #480: add an option to urlencode redirector URL
* New config: `$GLOBALS['config']['REDIRECTOR_URLENCODE']` (default `true`).
* Parameter added to LinkDB constructor.
* Fixes a bug with urlencode and escaped url.
* In `index.php`, LinkDB is now instanciate once for `importFile()` and `showDaily()`.
* TU
Diffstat (limited to 'tests')
-rw-r--r-- | tests/LinkDBTest.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index 52d31400..b055fe91 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php | |||
@@ -338,6 +338,13 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
338 | $db = new LinkDB(self::$testDatastore, false, false, $redirector); | 338 | $db = new LinkDB(self::$testDatastore, false, false, $redirector); |
339 | foreach($db as $link) { | 339 | foreach($db as $link) { |
340 | $this->assertStringStartsWith($redirector, $link['real_url']); | 340 | $this->assertStringStartsWith($redirector, $link['real_url']); |
341 | $this->assertNotFalse(strpos($link['real_url'], urlencode('://'))); | ||
342 | } | ||
343 | |||
344 | $db = new LinkDB(self::$testDatastore, false, false, $redirector, false); | ||
345 | foreach($db as $link) { | ||
346 | $this->assertStringStartsWith($redirector, $link['real_url']); | ||
347 | $this->assertFalse(strpos($link['real_url'], urlencode('://'))); | ||
341 | } | 348 | } |
342 | } | 349 | } |
343 | 350 | ||