[wp-trac] [WordPress Trac] #15058: Validate option and transient name lengths

WordPress Trac noreply at wordpress.org
Wed Oct 29 10:10:17 UTC 2014


#15058: Validate option and transient name lengths
--------------------------------+-----------------------------
 Reporter:  chrisjean           |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Future Release
Component:  Options, Meta APIs  |     Version:  3.1
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:
--------------------------------+-----------------------------

Comment (by khromov):

 Replying to [comment:35 voldemortensen]:
 >
 > khromov... 11 months ago you agreed that this kind of patch would be
 great...

 That patch was different, it would use md5 to "fill in" the rest of the
 transient name if it was too long, so you would still know at least the
 first 13 characters, which helps in identifying which plugin the transient
 belongs to.

 My position has been either using VARCHAR(256) or providing a filter (so
 people can use whatever prefixing scheme they want.)

 > Additionally, how do you propose we truncate things consistently? How
 would a theme/plugin know that its transient was truncated, and to be
 checking for a different value than the value they tried to set? It
 wouldn't make sense to cache something with the original value just to
 point to another value. That's too expensive.

 The easiest way would be to truncate the transient name after it is passed
 to get_transient(). Nacin opposed this kind of change because schema
 sanity checks aren't used in other places, which is a good point.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/15058#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list