Fragment, query

hefox - October 1, 2009 - 18:06
Project:CCK Redirection
Version:6.x-1.2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

It''d be useful to be able to redirect to a url with a fragment/query.

So far to get it working I changed

<?php
            $url
= parse_url($element['#item']['value']);
           
drupal_set_message(t('This node is redirected to a !r.', array('!r' => l(t('remote URI'), $url['path'],
                array(
'query'=>$url['query'],'fragment'=>$url['fragment'])
                ))));
?>

<?php
function _cck_redirection_divert($element) {
  if (!empty(
$element['#item']['value'])) {
    
$url = parse_url($element['#item']['value']);
   
drupal_goto($url['path'],$url['query'],$url['fragment']);
  }
}
?>

Reading the other issues I understand this module has issues with line endings so didn't make a patch (or rather... lazy fox, lazy).

Not sure how'd this effect remote urls, only tested for insite urls and it worked fine for both the message and the redirect.

 
 

Drupal is a registered trademark of Dries Buytaert.