Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There a two minor issues when printing links at the bottom of the page.
1. mailto links get the base_url in front of them
2. If your not using clean urls then the ?q= is printed twice.
I'm no programmer, but I made the following changes to the print_friendly_urls function to fix these issues.
Original code
if ($url) {
$urls[] = strpos($url, '://') ? $url : $base_url. '/'. url($url);
return count($urls);
}
New code
if ($url) {
/* $urls[] = strpos($url, '://') ? $url : $base_url. '/'. url($url); */
if (strpos($url, '://') | strpos($url, 'to:')) {
$urls[] = $url;
} else {
$urls[] = $base_url. '/'. $url;
}
return count($urls);
}
Thanks
Comments
Comment #1
deekayen CreditAttribution: deekayen commentedComment #2
deekayen CreditAttribution: deekayen commentedcommitted to cvs
Comment #3
peterjohnhartman CreditAttribution: peterjohnhartman commentedcommited to DRUPAL-4-7.
Comment #4
(not verified) CreditAttribution: commented