• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • [4.1 Beta 4] URL bbcode in template parameter can produce malformed link if URL option is not wrapped in quotes

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: [4.1 Beta 4] URL bbcode in template parameter can produce malformed link if URL option is not wrapped in quotes

    • Issue Tools
      • View Changes
    1. issueid=5918 November 6, 2019 8:37 AM
      ACL ACL is offline
      Regular Member
      [4.1 Beta 4] URL bbcode in template parameter can produce malformed link if URL option is not wrapped in quotes

      Demo: https://www.vaultwiki.org/xf-wiki/in...amTemplateTest

      The HTML <a> element ends up being output in the following format:
      Code:
      <a href="http://[oguyndm2" target="_blank" class="link link--external link-http" rel="noopener nofollow">[url]http://google.com[/url][/oguyndm2]]Google</a>
      (please ignore the [url] tags that are automatically added by the vBulletin message editor)

      The intended output is:
      Code:
      <a href="http://google.com" target="_blank" class="link link--external link-http" rel="noopener nofollow">Google</a>
    Issue Details
    Issue Number 5918
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Templates
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 4.1.0 Beta 4
    Fixed Version 4.1.1
    Milestone (none)
    Software DependencyAny
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. November 7, 2019 10:21 AM
      pegasus pegasus is offline
      VaultWiki Team
      Merged with https://www.vaultwiki.org/issues/5805/
      The example you posted is easier to reproduce and more visually apparent. Based on my understanding of the underlying issue, this occurs whenever a template parameter is used in the option value of any BB-Code, where that BB-Code's option is not wrapped in quotes.

      This is because in the absence of quotes, the option is expected to end at the next closing bracket ].
      When there is a nested BB-Code in the option, the nested BB-Code's closing bracket occurs first, which causes problems.
      Even if a template parameter contains only text and no BB-Codes, it still might contain BB-Codes in a different usage of the template. Also, all template parameters are turned into fake BB-Codes anyway where the replacement HTML is the parsed value of the content that was entered into the template call.

      Thus, best practice would be to quote-wrap any BB-Code options in templates if those options use template parameters.

      We may be able to work around this issue by trying to catch when a valid tag appears in a BB-Code option, and assuming that the tag option has not completed in that case. This may be easier to achieve in some platforms than others, if possible at all. This may be a technical limitation.
      Reply Reply  
    2. November 7, 2019 12:29 PM
      ACL ACL is offline
      Regular Member
      Thank you for taking the time to explain the suspected cause of this issue.

      Quote Originally Posted by pegasus
      Thus, best practice would be to quote-wrap any BB-Code options in templates if those options use template parameters.
      Yes, this seems like good advice - I'll be paying more careful attention to existing templates that don't currently wrap quotations around the BB code option values.

      It is worth mentioning that this issue has only come to light after upgrading my public site to VW4.1 Beta 4 (XF2.1 version). I don't recall this happening with VW4.0 (XF1.5 version), and an archive.org site snapshot confirms this. Other customer sites that make the same transition may begin to experience this issue in some of their existing templates without them realising it.
      Reply Reply  
    3. November 7, 2019 3:44 PM
      expanserpb expanserpb is offline
      Junior Member
      It broke our infobox templates in the migration, as highlighted in the merged ticket.
      Reply Reply  
    4. October 5, 2020 7:53 PM
      pegasus pegasus is offline
      VaultWiki Team
      This is fixed in the next release. When parsing a template, when locating BB-Code options within that template that are not wrapped in quotes, the BB-Code parser will double-check that new tags opened within the option were already closed, before deciding that the option has closed. The issue had only affected XenForo 2.

      Note: Within templates, this fix may interfere with other third-party add-ons, because it replaces a core XenForo method in that context.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 3:38 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.