Use relative URL

mfm - January 21, 2009 - 09:15
Project:Smileys
Version:6.x-1.0-alpha5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Smileys seems to use the absolute URL for the <img src="...">-part. It should use the relative URL (/sites/all/modules/smileys/packs/Tango/face-grin.png) instad of the full URL (https://www.menzer.net/sites/all/modules/smileys/packs/Tango/face-grin.png).

#1

Gurpartap Singh - January 21, 2009 - 13:34
Status:active» by design

No, it should use absolute URLs. Consider your content in RSS feeds, then it'll try to find Smileys image path relatively(in case we use relative path). If this is relative, it won't work! Happens often with screenshots/images on http://drupal.org/planet.

#2

ao5357 - May 22, 2009 - 20:43
Status:by design» needs review

Can't this be an option in the settings, instead of Gurpartap making the decision for all users of the module?

Consider the application:
A site has smileys enabled exclusively for the comment field of forums. There is no RSS feed for the comments in the forums, so all pageviews are at the site itself. There's a block on the user's profile page that shows the latest comments. Since the site uses SSL, but the cached content used a base path of http, the site throws annoying insecure errors.

Sure, this is an edge case, but as long as the alt text of the image is sufficiently-descriptive, I would be just fine with broken images in the RSS feeds.

#3

Gurpartap Singh - June 27, 2009 - 16:39

hmm, ok.

marked #403534: Smilie delivered over ssl as duplicate.

#4

roderik - July 11, 2009 - 23:59

Looking around at some issues*, it seems that the general consensus is that:
- modules like these should in fact always output relative URLs
- the RSS aggregator outputting broken URLs, is a bug that should be fixed in the RSS aggregator. (i.e. not in this module).

That is why I'm not too keen on making a configurable admin option. I just introduced a constant 'SMILEYS_ABSOLUTE_URLS' in the module which I will set to FALSE on my own site. My opinion is also that it should be FALSE by default, but I have kept it at TRUE in my patch so that it won't break 'compatibility' with earlier module releases.

* like #395764: Aggregator: Convert all relative URLs to absolute URLs in feed items, #88183: Relative urls in feeds

P.S. if you want to fix broken links in RSS feeds, you can apparently also install the pathologic module. (I haven't tried.)

AttachmentSize
361926.patch 2.89 KB

#5

hass - September 13, 2009 - 13:12

Wouldn't it not be better to figure out dynamically if the icon is shown on a webpage and if it's shown in RSS feeds? Every content that is cached in cache_filter need to be relative for not breaking with http/s...

 
 

Drupal is a registered trademark of Dries Buytaert.