WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10389 closed defect (bug) (fixed)

comment agent field too small for some user agents

Reported by: mrmist Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.8.1
Component: Comments Keywords: has-patch tested
Focuses: Cc:

Description

See http://wordpress.org/support/topic/288955?replies=1

The field comment_agent (varchar(255)) is too small for the user agent tag (which is, admittedly, long).

We should allow for this. Something like

ALTER TABLE wordpress.wp_comments MODIFY COLUMN comment_agent VARCHAR(355) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

Or whichever way WordPress makes schema changes..

Attachments (2)

10389.diff (1.4 KB) - added by Denis-de-Bernardy 5 years ago.
10389.2.diff (727 bytes) - added by Denis-de-Bernardy 5 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 mrmist5 years ago

  • Milestone changed from Unassigned to 2.9

comment:2 Denis-de-Bernardy5 years ago

  • Milestone changed from 2.9 to 2.8.2

Quick note on this:

http://sql-info.de/en/mysql/gotchas.html#1_5

http://sql-info.de/en/mysql/gotchas.html#1_13 (which is fixed in 4.1)

So we need to store a truncated user agent instead.

comment:3 mrmist5 years ago

It seemed ok against mysql 5 when I expanded the size of the varchar, but I agree the best approach would be to truncate the input to fit the size of the field. Definitely preferable to an error anyway.

comment:4 Denis-de-Bernardy5 years ago

the first gotcha got fixed in mysql 5 indeed.

Denis-de-Bernardy5 years ago

comment:5 Denis-de-Bernardy5 years ago

  • Keywords has-patch added; needs-patch removed

comment:6 Denis-de-Bernardy5 years ago

  • Component changed from General to Comments

Denis-de-Bernardy5 years ago

comment:7 mrmist5 years ago

  • Keywords tested added

Patch .2 looks good for it to me.

comment:8 azaozz5 years ago

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

(In [11713]) Truncate comment agent when longer than 255 chars, props Denis-de-Bernardy, fixes #10389

comment:9 azaozz5 years ago

  • Milestone changed from 2.8.2 to 2.9
Note: See TracTickets for help on using tickets.