The attached patch makes a link of the URL that is given below each file description input box in the attachment fieldset.

CommentFileSizeAuthor
upload_link.patch1.3 KBkkaefer

Comments

Stefan Nagtegaal’s picture

Can't we use l() here?

So instead of:

+      $description = '<small><a href="'. $url .'">'. $url .'</a></small>';

We do something like:

+      $description = '<small>'. l($url, $url) .'</small>';
kkaefer’s picture

The l() function is for Drupal internal links. See http://drupaldocs.org/api/head/function/l.

chx’s picture

And external urls...

kkaefer’s picture

Ok, but I don't see any sense in using l() for this purpose. We know that the URL doesn't contain any XSS chunks, nor HTML tags or attributes.

gerhard killesreiter’s picture

Status: Reviewed & tested by the community » Needs work

We like to use the APIs we provide.

dopry’s picture

Is there even a sane reason to allow users to click on a link that will take them away from the edit page?
Or it it for copy link location and paste?

kkaefer’s picture

Status: Needs work » Closed (won't fix)

dopry, you're probably right. Users that know what to do will copy & paste, others will get confused by this and probably even loose data. Set to wontfix.