Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#7904 closed defect (bug) (fixed)

get_attached_file bug

Reported by: arena's profile arena Owned by:
Milestone: 2.7 Priority: high
Severity: blocker Version: 2.7
Component: Administration Keywords: get_attached_file
Focuses: Cc:

Description

From the very last trunk of WordPress 2.7, i found a bug in "get_attached_file" function.

For my specific import, i have
(at step0)

this->file >>> C:
Vn
wp27/wp-content/uploads/2008/10/csv-semicolon-sample1csv13.import <<<

and have then with get_attached_file function (at step1)

this->file >>> C:\Vn\wp27/wp-content/uploads/C:\Vn\wp27/wp-content/uploads/2008/10/csv-semicolon-sample1csv13.import <<<

As you can see when retrieving the file name, the string "C:\Vn\wp27/wp-content/uploads/" is duplicated

My code is working on 2.6.2, not on 2.7.

Code is very similar to "wordpress" importer.

Change History (7)

#1 follow-up: @DD32
16 years ago

I dont think the bug is in get_attached_file() but rather, one of the functions which inserts the attachment.

Theres another ticket with a similar problem, i believe it was related to realpath() (But i cant find the ticket)

#2 in reply to: ↑ 1 @ryan
16 years ago

Replying to DD32:

I dont think the bug is in get_attached_file() but rather, one of the functions which inserts the attachment.

Theres another ticket with a similar problem, i believe it was related to realpath() (But i cant find the ticket)

#7118 ?

#4 @DD32
16 years ago

#7118 ?

Looks to be the one i was thinking of most likely

#7873

Hadnt seen that one yet, Looks to be the same issue, But i'm pretty sure i've seen a ticket with /home/blahblahblah/home/blahblahblah/.. Actually.. I dont think a trac ticket was filed, It was someone who emailed me about the problem with a plugin of mine(add-from-server) and the issue suddenly disapeared when i went to debug it.. The code in question was a direct copy-paste of the WP upload handling code of the time.

#5 @ryan
16 years ago

(In [9242]) Recognize windows absolute paths. see #7904

#6 @ryan
16 years ago

I don't have a windows box to test with, but I forced _wp_attached_file to be a windows style absolute path and [9242] seemed to fix the problem.

#7 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Closing as fixed. Reopen if needed.

Note: See TracTickets for help on using tickets.