• 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 3.x Series
    • Bug
    • IF doesn't use Param Value

    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: IF doesn't use Param Value

    • Issue Tools
      • View Changes
    1. issueid=1911 August 11, 2010 2:21 PM
      pegasus pegasus is offline
      VaultWiki Team
      IF doesn't use Param Value

      When using a template param in an IF statement, the IF statement should be processed if the template param contains the correct value.

      However, the statement is always processed as true, because template parameters are applied AFTER the template is parsed rather than before. I think this was to allow NOPARSE to prevent a param from being replaced, but if we wanted that, we could easily obfuscate the param by doing something like:
      Code:
      [noparse]{{[/noparse]{param|}[noparse]}}[/noparse]
      , or using a Template:Triple-Open-Brace/Triple-Close-Brace method. Such a sacrifice is worth keeping IF functional.

      Fixed for the next build. In vault/class/bbcode/template.php, find:
      Code:
      			$this->parser->options['do_html'] = $templateforum['allowhtml'];
      			$this->parser->options['do_bbcode'] = $templateforum['allowbbcode'];
      			$this->parser->options['do_smilies'] = $templateforum['allowsmilies'];
      			$this->parser->options['do_imgcode'] = $templateforum['allowimages'];
      
      			if (VAULT_403_COMPAT AND $htmlstate)
      			{
      				switch ($htmlstate)
      				{
      					case 'on':
      						$this->parser->options['do_nl2br'] = false;
      						break;
      					case 'off':
      						$this->parser->options['do_html'] = false;
      						break;
      					case 'on_nl2br':
      						$this->parser->options['do_nl2br'] = true;
      						break;
      				}
      			}
      			else
      			{
      				$this->parser->options['do_nl2br'] = true;
      			}
      
      			if (
      				!$this->parser->options['do_html'] AND
      				// don't do it if we're looking for other stuff
      				!$vault->parser['fake_tag_list'] AND
      				!$vault->parser['converted_text']
      			)
      			{
      				$template_text = htmlspecialchars_uni($template_text);
      			}
      
      			if ($templateforum['allowsmilies'])
      			{
      				$template_text = $this->parser->parse_smilies($template_text, $this->parser->options['do_html']);
      			}
      
      			$has_img_tag = ($templateforum['allowbbcode'] ? $this->parser->contains_bbcode_img_tags($text) : 0);
      
      			if ($has_img_tag AND !$templateforum['allowimages'])
      			{
      				$text = $this->noparse_img($text, $templateforum['allowbbcode'], $has_img_tag);
      			}
      
      			if ($templateforum['allowbbcode'])
      			{
      				$template_text = $this->parser->parse_bbcode(
      					$template_text,
      					$templateforum['allowsmilies'],
      					$templ['do_html']
      				);
      			}
      			else if (($_REQUEST['do'] != 'history' OR $_REQUEST['action'] == 'revision') AND !is_class_type($this->parser, 'plaintext'))
      			{
      				$template_text = $this->parser->parse_whitespace_newlines($template_text, $this->parser->options['do_nl2br']);
      			}
      
      			$this->parser->options = $orig_option;
      
      			$template_text = $this->process_template_params($template_text, $args);
      Replace with:
      Code:
      			$do_html = $templateforum['allowhtml'];
      			$do_bbcode = $templateforum['allowbbcode'];
      			$do_smilies = $templateforum['allowsmilies'];
      			$do_imgcode = $templateforum['allowimages'];
      
      			if (VAULT_403_COMPAT AND $htmlstate)
      			{
      				switch ($htmlstate)
      				{
      					case 'on':
      						$do_nl2br = false;
      						break;
      					case 'off':
      						$do_html = false;
      						break;
      					case 'on_nl2br':
      						$do_nl2br = true;
      						break;
      				}
      			}
      			else
      			{
      				$do_nl2br = true;
      			}
      
      			if (
      				!$do_html AND
      				// don't do it if we're looking for other stuff
      				!$vault->parser['fake_tag_list'] AND
      				!$vault->parser['converted_text']
      			)
      			{
      				$template_text = htmlspecialchars_uni($template_text);
      			}
      
      			$template_text = $this->process_template_params($template_text, $args);
      
      			$this->parser->options['do_html'] = $do_html;
      			$this->parser->options['do_bbcode'] = $do_bbcode;
      			$this->parser->options['do_smilies'] = $do_smilies;
      			$this->parser->options['do_imgcode'] = $do_imgcode;
      			$this->parser->options['do_nl2br'] = $do_nl2br;
      
      			if ($do_smilies)
      			{
      				$template_text = $this->parser->parse_smilies($template_text, $do_html);
      			}
      
      			$has_img_tag = ($do_bbcode ? $this->parser->contains_bbcode_img_tags($text) : 0);
      
      			if ($has_img_tag AND !$do_imgcode)
      			{
      				$text = $this->noparse_img($text, $do_bbcode, $has_img_tag);
      			}
      
      			if ($do_bbcode)
      			{
      				$template_text = $this->parser->parse_bbcode(
      					$template_text,
      					$templateforum['allowsmilies'],
      					$templ['do_html']
      				);
      			}
      			else if (($_REQUEST['do'] != 'history' OR $_REQUEST['action'] == 'revision') AND !is_class_type($this->parser, 'plaintext'))
      			{
      				$template_text = $this->parser->parse_whitespace_newlines($template_text, $do_nl2br);
      			}
      
      			$this->parser->options = $orig_options;
    Issue Details
    Issue Number 1911
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Templates
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 3.0.2
    Fixed Version 3.0.3
    Milestone VaultWiki 3.0.5
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    + 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:14 AM.
    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 © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.