mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
removed parameter from url_encode filter
the filter now only uses the more appropriate rawurlencode() which is also more consistent with the escape('url') filter
This commit is contained in:
committed by
Fabien Potencier
parent
4a7ef0ce0f
commit
49ba6b4759
@@ -590,21 +590,16 @@ function twig_number_format_filter(Twig_Environment $env, $number, $decimal = nu
|
||||
* URL encodes a string as a path segment or an array as a query string.
|
||||
*
|
||||
* @param string|array $url A URL or an array of query parameters
|
||||
* @param bool $raw true to use rawurlencode() instead of urlencode
|
||||
*
|
||||
* @return string The URL encoded value
|
||||
*/
|
||||
function twig_urlencode_filter($url, $raw = false)
|
||||
function twig_urlencode_filter($url)
|
||||
{
|
||||
if (is_array($url)) {
|
||||
return http_build_query($url, '', '&');
|
||||
}
|
||||
|
||||
if ($raw) {
|
||||
return rawurlencode($url);
|
||||
}
|
||||
|
||||
return urlencode($url);
|
||||
return rawurlencode($url);
|
||||
}
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
|
||||
|
||||
Reference in New Issue
Block a user