[wp-trac] [WordPress Trac] #35936: Add validation for Custom Structure permalinks

WordPress Trac noreply at wordpress.org
Thu Mar 3 16:01:14 UTC 2016


#35936: Add validation for Custom Structure permalinks
--------------------------------------+-----------------------------
 Reporter:  SteveNetRivet             |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  Permalinks                |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:  ui
--------------------------------------+-----------------------------

Comment (by swissspidy):

 @rockwell15 The latest patch works well. Some notes:

 Coding standards in general should be followed, see
 https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/php/. For example, strict comparison should be used in
 conditions (e.g. `false === strpos...` instead of `false == strpos...`).
 Always use braces, etc. Also, the error message needs to be translatable.

 While testing the patch I realized that `sanitize_option()` already does
 the error handling for us. [attachment:35936.diff] is an alternative
 approach taking advantage of that. Wording of the error message needs to
 be improved though.

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


More information about the wp-trac mailing list