[wp-trac] [WordPress Trac] #57242: Remove redundant dot in sanitize_file_name function

WordPress Trac noreply at wordpress.org
Sat Dec 3 06:12:24 UTC 2022


#57242: Remove redundant dot in sanitize_file_name function
-----------------------------------+------------------------------
 Reporter:  ArtZ91                 |       Owner:  (none)
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Formatting             |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------

Comment (by costdev):

 We could:

 1. Replace all instances of `..` (or more) with `.`
 2. Apply `rtrim( $filename, '.' )`.
 3. Append the extension.

 See https://3v4l.org/AeAuO

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


More information about the wp-trac mailing list