Skip to:
Content
Pages
Categories
Search
Top
Bottom

Usernames with spaces do not work

  • My username on my blog is “The Geek”, which does not work in bbPress… cannot even login, even though I’m already logged into WordPress.

    This is not an integration issue, because other usernames without spaces work perfectly fine between WordPress and bbPress.

    I’m comfortable with hacking the source… just wondering if anybody else has already found and fixed this issue already.

Viewing 25 replies - 1 through 25 (of 31 total)
  • Can’t remember if this plugin fixes that issue or not….maybe try it? Nothing else jumps out at me.

    Trent

    Doesn’t work for me… thanks for the suggestion though.

    I’ve noticed that the URLs such as the profile links are broken as well.

    I’m hoping there’s a plugin hook that I can use to override the default sanitize function… haven’t looked into it yet, but it seems like that’s where the problem is coming from.

    I created a plugin that allows usernames with spaces… not in the most elegant way, but it seems to work for me.

    <?php

    /*

    Plugin Name: HowToGeek Functions

    Plugin URI: http://www.howtogeek.com

    Description: Cleanup functions for bbPress issues

    Author: The Geek

    Author URI: http://www.howtogeek.com/

    Version: 0.0.1

    */

    function htg_resanitize( $text, $raw ) {

    return preg_replace(‘/[^ ta-z0-9_-]/i’, ”, str_replace(“%20″,” “,$raw));

    }

    function htg_repermalinkfix($permalink){

    return str_replace(” “,”%20″,$permalink);

    }

    add_filter(‘bb_repermalink_result’,’htg_repermalinkfix’,1,1);

    remove_filter(‘bb_user_sanitize’,’bb_user_sanitize’);

    add_filter(‘bb_user_sanitize’,’htg_resanitize’,1,2);

    ?>

    Note that the profile editing doesn’t seem to work for usernames with spaces. Will fix.

    Ok, this version fixes the issue with spaces in the profiles… it’s mostly a hack, but I haven’t found any issues with it.

    <?php

    /*

    Plugin Name: HowToGeek Functions

    Plugin URI: http://www.howtogeek.com

    Description: Cleanup functions for bbPress issues

    Author: The Geek

    Author URI: http://www.howtogeek.com/

    Version: 0.0.1

    */

    function htg_resanitize( $text, $raw ) {

    return preg_replace(‘/[^ ta-z0-9_-]/i’, ”, str_replace(“%20″,” “,$raw));

    }

    function htg_repermalinkfix($permalink){

    return str_replace(” “,”%20″,$permalink);

    }

    function htg_wp_redirect($location,$status){

    global $is_IIS;

    if(!stristr($location,’ ‘)){

    return $location;

    }

    $location = preg_replace(‘|[^ ta-z0-9-~+_.?#=&;,/:%]|i’, ”, $location);

    $location = wp_kses_no_null($location);

    $strip = array(‘%0d’, ‘%0a’);

    $location = str_replace($strip, ”, $location);

    if ( $is_IIS ) {

    header(“Refresh: 0;url=$location”);

    } else {

    if ( php_sapi_name() != ‘cgi-fcgi’ )

    status_header($status); // This causes problems on IIS and some FastCGI setups

    header(“Location: $location”);

    }

    return false;

    }

    add_filter(‘wp_redirect’,’htg_wp_redirect’,1,2);

    add_filter(‘bb_repermalink_result’,’htg_repermalinkfix’,1,1);

    remove_filter(‘bb_user_sanitize’,’bb_user_sanitize’);

    add_filter(‘bb_user_sanitize’,’htg_resanitize’,1,2);

    ?>

    Thank you for being awesome.

    Very nice! Proforumed!

    Trent


    signpostmarv
    Member

    @signpostmarv

    I came across the same problem on a combined wp/bbpress setup.

    twas a simple case of changing line 1079, template-functions.php

    $r = bb_get_option('uri') . "profile/" . $user->$column . ( 1 < $page ? "/page/$page" : '' ); to $r = bb_get_option('uri') . "profile/" . urlencode($user->$column) . ( 1 < $page ? "/page/$page" : '' );


    _ck_
    Participant

    @_ck_

    Wow this is a very serious issue – I couldn’t figure out why half my members could not log into the forum! Thought it was a cookie issue, but it was the space!

    I suggest this be moved to the integration section and highly recommend to everyone trying to merge BB with WP. I would never have spotted this if it had not been bumped by signpost (who’s code did not solve it unfortunately, I had to use the plugin)


    HowToGeek
    Member

    @howtogeek

    I should mention that my code is a horrible hack… hopefully they’ll fix the problem in the core.


    _ck_
    Participant

    @_ck_

    Was there a ticket in trac already for this? Because I just added one.

    There are so many integration problems in bbpress that IMHO feature additions should be on hold until tighter integration is achieved. I can’t see a major userbase other than WP users for bbpress.

    Actually according to Trent the majority do not integrate.

    It’s also worth noting that if you spend your time here you will only see the number of problems; unless you have data on the number of users and their setups, you can’t base an opinion on that.


    _ck_
    Participant

    @_ck_

    Wait, there are numerous people installing bbpress as their only website program without having WP installed? Why? It’s such an early, early beta and has virtually no administration features. Any mature forum program can blow it away right now. Are they masacists or just running really tiny, micro forums?

    Just out of curiosity, what are the largest known bbpress forums, other than the wordpress site and here? I suspect the forum I’ve integrated is probably in the top 10 since it has over 100 daily active users (with 800+ registered from the wordpress config).

    The big ones:

    http://bbpress.org/about/examples/

    As well, wordpress.com is a huge forum as well as the wordpress MU forum is getting there. Each of the wordpress forums have 2,000+ new registrations each day. Pretty large examples.

    Trent


    _ck_
    Participant

    @_ck_

    Ah thanks Trent, I thought I saw that list weeks ago but couldn’t find it again.

    I’m still not convinced bbpress’s “selling point” is speed or management as other forums seem just as lightweight and definitely more robust. But the biggest problem on any large forum is the sheer number of people doing searches at any given time.

    BBpress kinda cheats in this regard (keeping search overhead down) as it tries to enforce tags over searches (I’m not a big believer in user submitted tags when you have a lack of quality control over your members) and it’s search feature is so poor that no one will seriously use it right now (it cannot find whole words, limit by member, limit by forum, limit by subject, etc. etc. etc.)

    To me, I thought bbpress’s benefit was WP integration and I was familiar with the functions used after months of hacking wordpress. Wasn’t convinced the wordpress forum plugins were going to keep evolving or be flexible enough.

    I guess my problem is jumping in too soon, waited a year to add a forum to let projects like this mature but it’s still a bit early. By the winter the forum I setup should be as big as technorati – it definitely needs better management features.

    The advanced moderation and spam protection features of bbPress save the WP mod team tons of time.

    What advanced moderation features? Am I missing something? You have to actually go into each topic, go to each post and manually moderate. It kinda blows me away that there’s nowhere in the bbpress admin panel to see the last 50 posts like in wordpress. I’m coding the feature for myself right now…

    The spam is akismet protection, but the advanced moderation I am not quite sure about yet as plugins are the best options thus far.

    Trent


    _ck_
    Participant

    @_ck_

    Well akismet support can be added to virtually any forum or blog software so that’s not really a claim to fame. I tried installing the moderate posts plugin but it’s not working right and preventing all posts from being displayed.

    There’s also no way to tie any kind of “bad words” list into auto-moderation, and then how do you find any list of moderated posts? Sigh. All of this is already in wordpress so it’s really strange to me it’s not in bbpress by default.

    Well I’ll stop here and won’t tie up this particular topic with this further since you can’t move individual posts to other/new topics with bbpress (another missing moderation need).

    I guess everybody’s a masochist.


    HowToGeek
    Member

    @howtogeek

    I think the moderation functions are definitely severely lacking… but with Akismet integration you shouldn’t get much spam.

    The whole point of bbPress from my view is that it’s really simple for the users to actually use, and will hopefully generate more interaction because of that, especially from people that aren’t as forum-savvy.


    _ck_
    Participant

    @_ck_

    I’ve yet to see forum software that makes it hard for members to use/post?

    My problem is not really spam but a bunch of pre-teens running around and posting massive, rapid, rabid chats with each other like it’s a chat room. bbPress completely lacks any management tools to deal with that. If you ban them, they can re-register with a different nickname in less than 30 seconds. If you ban their ip, they just use a randomizing proxy.

    On my wordpress side I have it completely programmed with stop-words, how fast each member can post and decent moderation tools. But the forum, which from the start needs those abilities the most, does not have them.

    The Bad Words plugin by mdawaffe could be modified to be automatic couldn’t it (if it isn’t already) since it runs as a filter on posting. It is in the ‘extend’ section.

    Trent


    _ck_
    Participant

    @_ck_

    Apparently WordPress allows dots (periods) in usernames as well?! (it did at some point, not sure if it still does but I have users with nicknames like that)

    So I had to modify this plugin with a dot

    return preg_replace('/[^ ta-z0-9_.-]/i', '', str_replace("%20"," ",$raw));

    apparently php is very sensitive as to what order the pattern is in, that dot has to be right there in the sequence or it throws a shedload of errors.


    HowToGeek
    Member

    @howtogeek

    That’s good to know… I’ll update my local copy.


    _ck_
    Participant

    @_ck_

    I would encourage you to put this into the bbpress svn so it can be found under the plugin browser by the masses trying to integrate WP + BB

    (if I figured out how to use the SVN, anyone can!)

    What about @

    Many people use their email address as their login name.

    ARGH.

Viewing 25 replies - 1 through 25 (of 31 total)

You must be logged in to reply to this topic.