Results 1 to 13 of 13

vBSEO produces invalid HTML

This is a discussion on vBSEO produces invalid HTML within the Bug Reporting forums, part of the vBSEO SEO Plugin category; Without vBSEO Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" ...

  1. #1
    Junior Member
    Real Name
    Andreas
    Join Date
    Jul 2007
    Posts
    27
    Liked
    0 times

    vBSEO produces invalid HTML

    Without vBSEO
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html  xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>vBSEO Bug Test</title>
    </head>
    <body>
        <!--<a href="member.php?u=7329">*Dä*</a>-->
    </body>
    </html>
    With vBSEO
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html  xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>vBSEO Bug Test</title>
    </head>
    <body>
        <!--<a href="members/7329--dae-.html">*Dä*</a>-->
    </body>
    </html>
    This is invalid according to W3C Validator, also Firefox does not display it correctly.

  2. #2
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    13 times
    What is not displaying correctly? The only content is inside HTML comments as far as I can tell, so you should just get a blank page, right? Also, what is the error that the W3C Validator shows you for that snippet of code?

  3. #3
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    I think its an html problem on the double dash.

    7329--

    that double dash is causing the browser to look for the closing comment.


    The real fix here, is if you allow more than [a-z0-9 \s], then you should only use the members/userID/ rewrite style.

  4. #4
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    13 times
    You would think the browser would look for -->. Anything inside of <!-- and --> should be considered a comment and not rendered or validated anyway IMO.

    But yes, that probably isn't the best URL format to use when you have usernames with special characters.

  5. #5
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    HTML is derrived from SGML. This problem existed way back when on that full set too.

    read this:
    HTML and SGML comments

  6. #6
    Junior Member
    Real Name
    Andreas
    Join Date
    Jul 2007
    Posts
    27
    Liked
    0 times
    Validator output
    Code:
    # Line 8, Column 31: invalid comment declaration: found name start character outside comment but inside comment declaration.
    
        <!--<a href="members/7329--dae-.html">*Dä*</a>-->
    
    # Info Line 8, Column 4: comment declaration started here.
    
        <!--<a href="members/7329--dae-.html">*Dä*</a>-->
    
    # Error Line 8, Column 49: end tag for element "a" which is not open.
    
        <!--<a href="members/7329--dae-.html">*Dä*</a>-->
    
    
    The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
    
    If this error occurred in a script section of your document, you should probably read this FAQ entry.
    # Error Line 8, Column 29: XML Parsing Error: Comment not terminated .
    
        <!--<a href="members/7329--dae-.html">*Dä*</a>-->
    Firefox 2 visible output
    Code:
    *Dä*-->
    It dosnt't matter if the URL format is good or not. Fact is that vBSEO produces invalid HTML which leads to corrupted output so this needs to be fixed ASAP.

  7. #7
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    13 times
    Change you user profile URL format, and it will be corrected.

    Quote Originally Posted by briansol View Post
    The real fix here, is if you allow more than [a-z0-9 \s], then you should only use the members/userID/ rewrite style.

  8. #8
    Junior Member
    Real Name
    Andreas
    Join Date
    Jul 2007
    Posts
    27
    Liked
    0 times
    Quote Originally Posted by Keith Cohen View Post
    Change you user profile URL format, and it will be corrected.
    You suggest to change all existing URLs?

    Obviously this is not an option as it would make all indexed URLs invalid - a nightmare if this happens on Thread URLs.

    As a workaround, I'm going to remove the comment - but this is not a real fix either.

    Is this bug limited to profile URLs?

  9. #9
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    the 'bug' isn't a big at all. It's a limitation of HTML comments, as stated above.

    Use <?php //comments; ?> instead


    There's ZERO good reason to use HTML comments now a days.

  10. #10
    Junior Member
    Real Name
    Andreas
    Join Date
    Jul 2007
    Posts
    27
    Liked
    0 times
    I am certainly not willing to manually modify the templates on every forum I admin (the comment is a stock vBulletin comment!) just to get around this issue.

    Fact is that without vBSEO everything is fine. But with vBSEO, the HTML does not validate any longer and produces visible output corruption (at least in Firefox).

    So this is a bug in vBSEO!

    There's ZERO good reason to use HTML comments now a days.
    That's your opinion, and certainly not true.

    How would you insert AdSense section targeting using PHP comments for example?

  11. #11
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    13 times
    That is a default vBulletin HTML comment? Never noticed that before. Makes no sense why it would be there anyway.

    Quote Originally Posted by KirbyDE View Post
    So this is a bug in vBSEO!
    If anything, it is only a bug in the sense that based on the fact that you allow special characters in user names, then you will need to modify the URL format to correct the issue.

  12. #12
    Junior Member
    Real Name
    Andreas
    Join Date
    Jul 2007
    Posts
    27
    Liked
    0 times
    It was (at least up til 3.7 RC 1).

    Template pm_messagelistbit_user.

    I havn't tried with thread titles, but I think it could happen there as well - and disallowing umlauts for thread titles or changing the url format with several tenthousand threads indexed is certainly not an option.

    Therefore I insist that this is a bug that needs to be fixed.

  13. #13
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    I don't think there's an html comment with the thread in it anywhere, is there? I haven't seen it. so i don't think this will ever effect threads.

    At the end of the day, it's not a bug, but rather a limitation.

    You could set up to use |'s instead of -'s for replacement, but then you might run into a logical OR (||) somewhere...

    So, I re-iterate what I originally stated. If you allow special characters, you shouldn't use them as part of the URL, and use the ID instead.

    You can change just the member's re-write which won't effect your indexed thread counts at all.

Similar Threads

  1. HTML Error Tag and VBSEO?
    By maternity.com in forum Off-Topic & Chit Chat
    Replies: 4
    Last Post: 06-21-2006, 08:11 PM
  2. VBseo and VBulletin .html extensions
    By korzon in forum Pre-Sales Questions
    Replies: 4
    Last Post: 03-27-2006, 03:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •