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
This commit is contained in:
parent
9486a2e929
commit
043eae70c4
3 changed files with 47 additions and 25 deletions
tests
|
@ -338,6 +338,13 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
|
|||
$db = new LinkDB(self::$testDatastore, false, false, $redirector);
|
||||
foreach($db as $link) {
|
||||
$this->assertStringStartsWith($redirector, $link['real_url']);
|
||||
$this->assertNotFalse(strpos($link['real_url'], urlencode('://')));
|
||||
}
|
||||
|
||||
$db = new LinkDB(self::$testDatastore, false, false, $redirector, false);
|
||||
foreach($db as $link) {
|
||||
$this->assertStringStartsWith($redirector, $link['real_url']);
|
||||
$this->assertFalse(strpos($link['real_url'], urlencode('://')));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue