Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-548 now.

Can't comment out conditionals (fix completed in vcs)

Try commenting out a conditional in any template like so:

Code: Select all
<!-- <!-- IF WHATEVER --><br /><b>{WHATEVER }:</b><!-- ENDIF --> -->


I wanted a few things to not display, but I wanted to leave the HTML in tact so that if I ever wanted to display it again I could just remove the comments.

I'm no regex expert, but could this just be a simple change to check if the conditional occurs after the first comment tag?

Comments / History

Posted by Acyd Burn (Server Manager) on May 18th 2006, 11:53

Actually, you can. Wink

Code: Select all
<!--
<!-- IF WHATEVER --><br /><b>{WHATEVER }:</b><!-- ENDIF -->
//-->

Posted by The Letter J on May 18th 2006, 16:44

Should it not work with the standard syntax of an HTML comment?

Posted by Acyd Burn (Server Manager) on May 18th 2006, 16:58

Yes, normally it should work (the template variables get parsed and then displayed, meaning there is no comment between your html comments within the actual output).

If you write it as you reported it... is it giving any errors to you, or what happens...

Posted by The Letter J on May 18th 2006, 17:21

I get a blank screen.

Posted by scandal20 on May 18th 2006, 17:36

Did some testing with this and here is what I came up with. These do NOT work:
Code: Select all
<!-- <!-- IF WHATEVER --><br /><b>{WHATEVER }:</b><!-- ENDIF --> -->

Code: Select all
<!-- <!-- IF WHATEVER --><br /><b>{WHATEVER }:</b><!-- ENDIF --> //-->

They result in this error:
Parse error: syntax error, unexpected '}' in /var/www/<my site>/htdocs/phpBB2/includes/template.php(509) : eval()'d code on line 107

These DO work:
Code: Select all
<!--
<!-- IF WHATEVER --><br /><b>{WHATEVER }:</b><!-- ENDIF -->
//-->

Code: Select all
<!--
<!-- IF WHATEVER --><br /><b>{WHATEVER }:</b><!-- ENDIF -->
-->

As well as:
Code: Select all
<% <!-- IF WHATEVER --><br /><b>{WHATEVER }:</b><!-- ENDIF --> %>

Posted by The Letter J on May 18th 2006, 17:55

Well, I guess it's not really a big deal. It's strange that you can't do it on the same line though, it shouldn't really matter code-wise.

Linked ticket with changeset: r5946

Action performed by Anonymous (I am too lazy to register) on May 20th 2006, 14:41

Ticket details

Related SVN changesets