Bad path in code?

AppleBag - April 10, 2009 - 18:27
Project:Smileys
Version:5.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

In my watchdog logs, I frequently get an error like this;

Page Not Found: smileys/packs/Yahoo/daydream.gif

Even though most of the time it is found in the block of smileys, and it's text version that gets replaced with the smiley works.

The path on my server to the actual file is this: http://foobar.com/sites/all/modules/smileys/packs/Yahoo/daydream.gif

Anyone have any suggestions how to rectify this error?

#1

Gurpartap Singh - June 27, 2009 - 17:05

Well, it's very possible someone is hot linking the image, with an incorrect path to the image. Check referrer for those reports. Almost good to ignore.

#2

AppleBag - September 8, 2009 - 04:09

Hi Gurpartap

I still have this issue and would like to fix it. I have confirmed this is a code issue and not a hot linking issue. I'd like to ignore it, however, I get pages and pages of these errors filling my watchdog. Apparently somewhere in the module it's trying to read the path to the smiley using only the base path, like this: http://mysite.com/smileys/packs/Yahoo/daydream.gif while in reality the image is here in the modules folder: http://mysite.com/sites/all/modules/smileys/packs/Yahoo/daydream.gif.

Looking over the code a little bit I see a lot of these:

check_url(base_path() . $smiley->image)

I am wondering if it shouldn't be something more along the lines of this?

$smileypath = drupal_get_path('module', 'smileys');

check_url($smileypath . $smiley->image);

?

 
 

Drupal is a registered trademark of Dries Buytaert.