Fix bug #3097187: Using opensearch with two tags does not work in Firefox

This commit is contained in:
Christian Weiske 2011-04-15 07:55:06 +02:00
parent 5d22905ce7
commit a25838b267
3 changed files with 60 additions and 4 deletions

View file

@ -6,6 +6,7 @@ ChangeLog for SemantiScuttle
- Switch to jQuery and drop dojo
- Fix bug #3187177: Wrong URL / Export XML Bookmarks
- Fix bug in getTagsForBookmarks() that fetched all tags
- Fix bug #3097187: Using opensearch with two tags does not work in Firefox
- Implement request #3054906: Show user's full name instead of nickname
- Implement patch #3059829: update FR_CA translation
- Show error message on mysqli connection errors

53
tests/www/searchTest.php Normal file
View file

@ -0,0 +1,53 @@
<?php
class www_SearchTest extends TestBaseApi
{
protected $urlPart = 'search.php';
/**
* Some browsers using opensearch do "urlencode" on the terms,
* for example Firefox. Multiple terms separated with space
* appear as "foo+bar" in the URL.
*/
public function testMultipleTermsUrlEncoded()
{
$this->addBookmark(null, null, 0, null, 'unittest foo bar');
$res = $this->getRequest('/all/foo+bar')->send();
$this->assertSelectCount(
'.xfolkentry', true, $res->getBody(),
'No bookmark found'
);
$res = $this->getRequest('/all/baz+bat')->send();
$this->assertSelectCount(
'.xfolkentry', false, $res->getBody(),
'Bookmarks found'
);
}
/**
* Some browsers using opensearch do "rawurlencode" on the terms,
* for example Opera. Multiple terms separated with space
* appear as "foo%20bar" in the URL.
*/
public function testMultipleTermsRawUrlEncoded()
{
$this->addBookmark(null, null, 0, null, 'unittest foo bar');
$res = $this->getRequest('/all/foo bar')->send();
$this->assertSelectCount(
'.xfolkentry', true, $res->getBody(),
'No bookmark found'
);
$res = $this->getRequest('/all/baz bat')->send();
$this->assertSelectCount(
'.xfolkentry', false, $res->getBody(),
'Bookmarks found'
);
}
}
?>

View file

@ -58,6 +58,8 @@ if(count($exploded) == 4) {
list($url, $range, $terms) = $exploded;
$page = NULL;
}
//some OpenSearch clients need that
$terms = urldecode($terms);
$tplVars['loadjs'] = true;