Make WordPress Core

Opened 3 years ago

Closed 7 months ago

#17296 closed defect (bug) (fixed)

Link Descriptions Are Truncated Without Notification

Reported by: achmafooma Owned by: nacin
Milestone: 3.7 Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: has-patch commit
Focuses: Cc:


When creating new links, or editing existing links, using the WordPress admin interface, link descriptions are truncated to 255 characters. This is because there is a 255 character limit defined in the link_description column in the wp_links database table.

Steps to reproduce:

1) Go to WP dashboard

2) Select Links > Add New from the menu.

3) Create a link with a description longer than 255 characters.

4) Go back to the link in the links interface; the description has been truncated.

Expected behavior:

1) The field should have a larger limit (perhaps 1024 characters?).

2) Even if we keep the limit at 255, the UI should prevent users from entering more than the limit, or notify them that the description they have entered will be truncated to the limit.

Thanks for your time!

Attachments (2)

17296.diff (3.4 KB) - added by solarissmoke 3 years ago.
17296.2.patch (3.1 KB) - added by c3mdigital 8 months ago.
maxlength="255" refresh of original patch

Download all attachments as: .zip

Change History (9)

comment:1 solarissmoke3 years ago

  • Keywords has-patch dev-feedback added

Patch adds maxlength attributes to fields that have limited space in the database (like we do elsewhere). Maybe the devs can weight in on changing the character limit for the description.

Related: #12264

solarissmoke3 years ago

comment:2 Denis-de-Bernardy3 years ago

If we're supporting MySQL 5.0.3, bumping the limit in the schema seems like a better option... (Max is a bit over 65k)


comment:3 dd323 years ago

If changing the database is an option, changing it to a TEXT field would be worth it. However, I'd personally lean away from that and bring up migrating links to Custom Post Types instead. For something that's had a 255char limit for over 7 years, I don't see a great requirement or request to change that.

I do like the suggested patch here of simply adding the maxlength HTML attribute, at least it prevents people from entering longer strings.

c3mdigital8 months ago

maxlength="255" refresh of original patch

comment:4 c3mdigital8 months ago

  • Keywords dev-feedback removed
  • Version changed from 3.1 to 2.7

+1 for adding maxlength HTML attribute

comment:5 ocean908 months ago

  • Milestone changed from Awaiting Review to 3.7

I'm fine with adding maxlength here, since the link manager is officially "removed" from core, see #21307.

Should do the same for #12264.

comment:6 johnbillion7 months ago

  • Keywords commit added

Sane change. Patch still applies cleanly.

comment:7 nacin7 months ago

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

In 25670:

Links manager: Restrict field length based on DB schema.

props solarissmoke, vinod-dalvi.
fixes #17296, #12264.

Note: See TracTickets for help on using tickets.