The l() function modifies ampersand & Symbols in querystrings to & a m p ; This is done by the check_url function:
l() => check_url() => filter_xss_bad_protocol() => check_plain() => htmlspecialchars().

I've read about this problem, but it doesn't seem to be fixed.

Comments

pwolanin’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Are you passing your query in as the fourth parameter of l() ?

http://api.drupal.org/api/5/function/l

I only see $path being subjected to the treatment you describe.

kenorb’s picture

kenorb’s picture

Code:

l($text = 10, $path = 'search/all', $options = array ('path' => '/search/all', 'query' => array ('s' => 'teacher', 'items_per_page' => 10)));

Generated URI:

/search/all?s=teacher&items_per_page=10
damien tournoud’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

This is by design.

See #399488-16: Invalid markup generated by l(). for context.

kenorb’s picture

Thank you.

ramsunvtech’s picture

Simply decode the Output of l (link) function

$link = (t('Title'),$url, array('attributes' => array('target' => '_blank')));
$button_link = rawurldecode($link);