Special characters in URLs are escaped in Views
cubbtech - October 6, 2009 - 18:23
| Project: | Links Package |
| Version: | 6.x-2.x-dev |
| Component: | Code: links_views.inc |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
When creating a View in which the link title is output as a hyperlink with the link URL as its href value, (e.g., using [url] as your replacement pattern) special characters in URLs are escaped. This leads to a URL such as:
http://www.example.com/query1=value&query2=value&query3=valueBeing changed to:
http://www.example.com/query1=value&query2=value&query3=valueWhich breaks the link's functionality.
For now, this can be solved by creating a file called views-view-field--link-title.tpl.php in your theme directory, with the following code:
<?php
$text = $row->{$field->field_alias};
$path = $row->links_url;
$output = l($text, $path);
print $output;
?>