Upload “Link To File” bug
If you’ve tried attaching to the post any non-image file upload using the “Link To File” option, the link will not work because the generated URL is wrongly pointed to wp-admin folder.
The generated URL
<a id="p4" title=test.zip href="http://localhost/wordpress/wp-admin/test.zip">test.zip</a>
This applies to WordPress 2.0 - 2.0.4, for attaching non-image file, using “Link To File” option only.
This bug has been reported and fixed at wordpress forum, but it seems to have escaped the development team’s attention since 2.0 (maybe it wasn’t logged into the bug tracker).
To fix it,
1. edit wp-admin\inline-uploading.php
2. at line 265 (WordPress 2.0.4): replace
href=\"{$filename}\"
with
href=\"{$attachment['guid']}\"
3. The URL should now look something like this
<a id="p4" title=test.zip href="http://localhost/wordpress/wp-content/uploads/2006/09/test.zip">test.zip</a>
Related Link
About this entry
You’re currently reading “Upload “Link To File” bug,” an entry on my black room
- Published:
- 09.08.06 / 1am
- Category:
- WordPress
No comments
Jump to comment form | comments rss [?] | trackback uri [?]