[buddypress-trac] [BuddyPress] #4216: bp_core_redirect ignores spaces in user domains.

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon May 21 23:24:04 UTC 2012


#4216: bp_core_redirect ignores spaces in user domains.
--------------------------+-----------------------------
 Reporter:  DennisSmolek  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Messaging     |    Version:  1.5.5
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 While working on a site I noticed that when users send messages the
 redirect to view the message comes back as a 404.
 I didn't notice because my display name was admin but my users are
 formatted as Firstname Lastname as their display name.

 This means their standard $bp->loggedin_user->domain looks like:
 http://mysite.com/members/Firstname Lastname/

 So the expect Result from the redirect is something like:
 http://mysite.com/members/Firstname Lastname/messages/view/11/

 But the actual result is:
 http://mysite.com/members/FirstnameLastname/messages/view/11/

 Which results in a 404.

 I tracked down the issue and it deals with wp_redirect() and more
 importantly wp_sanitize_redirect()

 Now I know spaces are generally frowned upon so thats why it's happening
 but I don't know how to format the domain to not have the spaces.

 In the mean time a am just adjusting the filter wp_redirect to change
 spaces to %20 which is what it should do.. And it works fine.

 bp_core_redirect could do this as well to $bp->loggedin_user->domain
 before it passes to wp_redirect().

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4216>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list