Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 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:


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 11 years ago.
10389.2.diff (727 bytes) - added by Denis-de-Bernardy 11 years ago.

Download all attachments as: .zip

Change History (11)

#1 @mrmist
11 years ago

  • Milestone changed from Unassigned to 2.9

#2 @Denis-de-Bernardy
11 years ago

  • Milestone changed from 2.9 to 2.8.2

Quick note on this:


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.

#3 @mrmist
11 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.

#4 @Denis-de-Bernardy
11 years ago

the first gotcha got fixed in mysql 5 indeed.

#5 @Denis-de-Bernardy
11 years ago

  • Keywords has-patch added; needs-patch removed

#6 @Denis-de-Bernardy
11 years ago

  • Component changed from General to Comments

#7 @mrmist
11 years ago

  • Keywords tested added

Patch .2 looks good for it to me.

#8 @azaozz
11 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

#9 @azaozz
11 years ago

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