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 |
Jump to:
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
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
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);
?