[wp-trac] [WordPress Trac] #4411: clean_url() should not encode ampersands on the way to the db

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 5 23:05:46 GMT 2007


#4411: clean_url() should not encode ampersands on the way to the db
----------------------------+-----------------------------------------------
 Reporter:  ryan            |       Owner:  ryan       
     Type:  defect          |      Status:  new        
 Priority:  normal          |   Milestone:  2.3 (trunk)
Component:  Administration  |     Version:  2.2        
 Severity:  normal          |    Keywords:             
----------------------------+-----------------------------------------------
 clean_url() replaces ampersands with &.  This is fine when the url is
 being echoed, but not when the url is being saved to the db.  If the
 encoded url is fetched from the db and passed to parse_url(), parse_url()
 will think the # denotes a fragment.  clean_url() needs context to know
 whether the url should be prepared for display or save.  Attached patch
 adds a context arg to clean_url() and uses it in widgets.  We'll probably
 need to have a separate function to clean urls for the db so that it can
 be used in filters that expect the callback function to take one argument.
 clean_url calls for author, link, and link RSS urls need to be audited.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4411>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list