Is there a way to stop ? and = being converted to %3F and %3D? I have links that are query strings (eg gallery/?tid=1) and the url ends up mangled.

My current short term bandaid solution is to use Redirect to redirect (strangely) the mangled url to the proper one and hopefully my clients will only want to change the images on their buttons and not touch the link.

Thank you for the module, saved me having to try to wrangle something :)

Comments

galactus86’s picture

this is a great module. I'm having similar issue trying to add anchor tags to end of a URL, '#" is turned into %23. Any chance there is a patch for this?

cozzamara’s picture

I got the same issue with query string in link parameter. "?" is converted in "%3F" and "=" in "%3D" in the tag and the url is not valid when clicked.
Please fix it

cozzamara’s picture

This happens when in the link field I don't specify full target of link.
For example when the link is "node/2218683" instead of "https://www.drupal.org/node/2218683".

cozzamara’s picture

		// Code Added
		$imgQuery = $data['imageblock_link'];
		$urlInfo = parse_url($imgQuery);
		if (empty($urlInfo['host'])){
			$imgQuery = (isset($_SERVER['HTTPS']) ? "https" : "http")."://".$_SERVER['SERVER_NAME'].'/'.$urlInfo['path'];
			if (array_key_exists('query', $urlInfo))
				if (!empty($urlInfo['query']))
					$imgQuery .= '?'.$urlInfo['query'];
			if (array_key_exists('fragment', $urlInfo))
				if (!empty($urlInfo['fragment'])){
					$imgQuery = $imgQuery.'#'.$urlInfo['fragment'];
				}
		}
                $data['imageblock_link']=$imgQuery;
		//End Added

Adding this code before
$variables['image'] = l($variables['image'], $data['imageblock_link'], array('html' => TRUE, 'attributes' => $attributes));

Solve the issue for me.

cozzamara’s picture

Priority: Minor » Major
cozzamara’s picture

Category: Support request » Bug report