The MU forums have moved to WordPress.org

bloginfo('url') has a weird bug or feature (12 posts)

  1. Melodiefabrieknl
    Member
    Posted 16 years ago #

    bloginfo('url') misses to put a last '/' at the end of the url, because of that pages are not being corrected correctly. For example

    http://www.someurl.com/myblogname will generate a next page like this:
    http://www.someurl.com/myblogname/myblogname/page/2/

    Yes, indeed: the blogname is doubled. That would never happen when bloginfo('url') would generate:

    http://www.someurl.com/myblogname/
    (with a '/' at the end)

    To correct this I am adding '/' after the bloginfo('url') request, but this is not how it should work.

  2. lunabyte
    Member
    Posted 16 years ago #

    That's how it's always worked.

    Why would MU be any different?

  3. Melodiefabrieknl
    Member
    Posted 16 years ago #

    since MU can work with subdirectories, I don't find this all so logical. but maybe it's just me.

  4. lunabyte
    Member
    Posted 16 years ago #

    Must be. That's the way WP works, always has, and therefore so does MU.

  5. drmiketemp
    Member
    Posted 16 years ago #

    A link to where this is occuring would be helpful. We may see something that you don't. I have a client running mu in subdirectories and we're not seeing this.

  6. xiand0
    Blocked
    Posted 16 years ago #

    lunabyte, your "It's always been broken, so why should someone fix it now?" argument is .. interesting.

    Melodiefabrieknl, yes, bloginfo('wpurl') really is broken, and you really do have to add a '/'. Write down that "bloginfo('url') is broken and cosidered (yet another) WONTFIX issue, so remember to add a / when you use it."

    drmike, just echo get_bloginfo('wpurl'); and see for yourself. As lunabyte points out, it's always been broken in both WP and WPMU. The reason you're not seeing this is that the normal reaction (what I did anyway) is to find the error, work around it (add the / yourself) & make a mental note that it's broken. It's not like you or your client would suddenly notice that this is broken being that you can't really write any WP/WPMU PHP code using this function without taking into account that it's broken.

  7. SteveAtty
    Member
    Posted 16 years ago #

    I run in subdirectories and don't have the problem you mention with doubling up.

    Why is it wrong not to put a trailing slash on the end? There is no right or wrong when it comes to things like this. As long as it is consistent and you can code for it I don't see what the problem is

  8. drmiketemp
    Member
    Posted 16 years ago #

    Steve, some setups require the trailing slash.

    drmike, just echo get_bloginfo('wpurl'); and see for yourself.

    I did. You missed the bit about not seeing this. The missing trailing slash is not an issue with our setups and we've not seen the duped subdirectory.

    I'm looking more at the duped subdirectories though as the issue here. The missing trailing slash is a known issue that's been brought up in the main wp trac a couple of times although it's never been explained fully by the reporter so it gets closed with a WONTFIX or WORKSFORME. I think the issue is when wp is installed in a addon domain and not the main domain of an account. That's the only time I've seen it as an issue on my own installs and I can dupe it there. (It always redirects to the main site and usually loads a 404 of the main site if it can't find anything.)

    I'd suggest bringing it up yet again but 1) we've noted many times over that the wp developers fixing issues out of the wp trac will not deal with wpmu generated issues even if provened to exist on the wp platform as well and 2) it's been brought up before and ignored as stated up above.

    Best bet would be to fix it yourself and keep a note of it for future upgrades. It's not going to get fixed.

  9. lunabyte
    Member
    Posted 16 years ago #

    @xiand0...

    It isn't broken.
    It isn't broken.
    It isn't broken.

    I never said that, so don't put words in my mouth.

    That's just the way it works. It's a url, and like Steve said, there isn't a right or wrong way. If you DON'T like how it works, the code is open so feel free to modify it to fit your personal needs.

  10. SteveAtty
    Member
    Posted 16 years ago #

    And the worse thing they can do now is "fix" it as any code out that that assumes it will not be there will then end up with // in it. OK thats not a major problem but.....

  11. lunabyte
    Member
    Posted 16 years ago #

    Well, yeah, it is.

    How many plugins and such would break, as well as stuff in the core that would have to be fixed.

    Now, if you want an argument that is valid, how about:

    Why does get_info('home'), or url, wpurl, etc, not get trailing slashed but yet things like ABSPATH do?

    Which, can lead to confusion, and just plain looks funny in an include.

    That would be a logical question. Although, again, there isn't a right or wrong way for it, that's just how it works. However, the point would be that you would "think" there was some sort of internal standard for the application and situations like that, but they don't seem to have them for this. Which, is why links don't have it, and paths do.

  12. drmiketemp
    Member
    Posted 16 years ago #

    Again it's moot because the developers don't see it as an issue.

    Update: Actually it looks like they're discussing it yet again:

    http://trac.wordpress.org/ticket/4554

About this Topic

  • Started 16 years ago by Melodiefabrieknl
  • Latest reply from drmiketemp