Skip to content
Snippets Groups Projects
Commit 0dfaeedd authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #61720 : do not use sprintf on string that can contains url encoded chars

parent 2e893e8e
Branches
Tags
3 merge requests!2334Master,!2301Master,!2272hotline #61720 : do not use sprintf on string that can contains url encoded chars
Pipeline #2180 passed with stage
in 21 minutes and 19 seconds
- ticket #61720 : paramétrage de la recherche élargie : ajout du support des urls contenant des caractères encodés
\ No newline at end of file
......@@ -68,6 +68,6 @@ class ZendAfi_View_Helper_TagSearchExtension extends ZendAfi_View_Helper_BaseHel
protected function _injectSearchTerm($url) {
return sprintf($url, $this->_criteres->getExpressionRecherche());
return str_replace('%s', $this->_criteres->getExpressionRecherche(), $url);
}
}
\ No newline at end of file
......@@ -112,11 +112,13 @@ class RechercheControllerSearchExtensionEnabledTest
return ['site_label' => ['Jumel',
'Incomplete',
'Trouvons.org',
'Gallica'],
'Gallica',
'Patrimoine Martiniquais'],
'site_url' => ['http://www.jumel39.fr/rechercher?search_api_views_fulltext=%s',
'',
'http://trouvons.org/#q=%s',
'http://gallica.bnf.fr/services/engine/search/sru?operation=searchRetrieve&version=1.2&query=(gallica all "%s")']];
'http://gallica.bnf.fr/services/engine/search/sru?operation=searchRetrieve&version=1.2&query=(gallica all "%s")',
'http://www.patrimoines-martinique.org/?form_search_fulltext=%s&btn_valid=%C2%A0%C2%A0%C2%A0%C2%A0Trouver&action=search&id=chercher_liste']];
}
......@@ -151,6 +153,13 @@ class RechercheControllerSearchExtensionEnabledTest
$this->assertXPathContentContains('//a[contains(@href, "gallica all ")][contains(@href, "sport")]',
'Gallica');
}
/** @test */
public function shouldRenderPatrimoineMartiniquais() {
$this->assertXPathContentContains('//a[contains(@href, "form_search_fulltext=sport&")]',
'Patrimoine Martiniquais');
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment