Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#41272 new defect (bug)

Unattached media URLs broken for anything over 1000

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Permalinks Keywords:
Focuses: Cc:

Description

Steps to reproduce

  1. On your local computer, rename a file to 1180.jpg
  2. Upload the file to the Media Library
  3. Visit example.com/1180

You will get a 404 broken link.

If you do the same for a 1, 2 or 3 digit filename, you won't see the issue.

example.com/31.jpg // Works
example.com/872.jpg // Works

The problem isn't just related to images.

example.com/1871.mp3 // 404

Change History (6)

#1 @SergeyBiryukov
7 years ago

  • Component changed from General to Permalinks

Related: #5305, #13459, #24612.

#2 @henry.wright
7 years ago

I can't seem to edit the examples I gave in the ticket description but they should read:

31.jpg
example.com/31 // Works

872.jpg
example.com/872 // Works

and

1871.mp3
example.com/1871 // 404

#3 follow-up: @henry.wright
7 years ago

I just tested again on a fresh install with no existing posts. Same issue. This indicates that this isn't a permalink conflict.

#4 in reply to: ↑ 3 @SergeyBiryukov
7 years ago

Replying to henry.wright:

I just tested again on a fresh install with no existing posts. Same issue. This indicates that this isn't a permalink conflict.

Right. If I had to guess, a 4-digit number is treated as a year instead of an attachment slug. I thought #5305 fixed that, but apparently not for all cases.

#5 @henry.wright
7 years ago

I still see the problem if I use a 5-digit number (11598.jpg). I guess that rules out the year theory, unless 5-digit numbers are also treated as years?

#6 @bhargavbhandari90
7 years ago

Hi @henry.wright ,

I tested this issue, but I didn't get the issue with 5 digit.
And yes @SergeyBiryukov , it is treated as a year. That's why it is gettong 404.

Note: See TracTickets for help on using tickets.