View Bug #507

Summary: Extra closing tags are not caught as error

Difficulty: 3    Version goal: 1.4   
Status: Unassigned   
Version found: 1.10    Severity: Minor      

Description
This component triggers no compile-time error:

   Hi!

</%perl> </%init> %> &>

Instead, the ending tags are all sent as output.

History

Sep 17, 2003 10:56 AM   Jonathan Swartz created bug.
Sep 17, 2003 10:56 AM   Jonathan Swartz set version_found to 1.10.
Sep 17, 2003 10:56 AM   Jonathan Swartz set severity to Minor.
Sep 17, 2003 10:57 AM   Jonathan Swartz modified summary.
Sep 18, 2003 10:05 AM   Dave Rolsky changed difficulty from 1 to 3.
Sep 18, 2003 10:05 AM   Dave Rolsky writes: I'm not sure we should bother "fixing" this, as I'm not convinced it's broken.

Note that we also don't catch thing like "&>" or "%>" or any other ending without a beginning. Because of the way the parsing is done, we'd have to add explicit checks for all possible endings without beginnings.

I'm not convinced that this is really worthwhile.

Sep 21, 2003 06:12 PM   Jonathan Swartz writes: Oh, it's definitely broken - a parser should reject invalid syntax just as it accepts valid ones. Perl's one of the most permissive languages around and it still flags this:

   % perl -p -e 'print "hi" }'

Unmatched right curly bracket at -e line 1, at end of line

Whether it's worth fixing is a reasonable question. Would you expect an impact on performance or just code complexity? If it's just the latter, we should do it. Even if a performance impact shouldn't necessarily deter us, because you only incur the cost once per component change.

I'm willing to take a stab at it if you just don't feel like doing the coding. :) Are </%section_name>, %>, and &> are the only three endings we'd have to look for?

Sep 21, 2003 06:19 PM   Jonathan Swartz modified summary.
Sep 21, 2003 06:22 PM   Jonathan Swartz writes: Just realized that all these extra end tags are sent as output, not ignored as I previously thought.