Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this a bug? #95

Open
krionix1981 opened this issue May 29, 2024 · 1 comment
Open

Is this a bug? #95

krionix1981 opened this issue May 29, 2024 · 1 comment

Comments

@krionix1981
Copy link

krionix1981 commented May 29, 2024

Hi

Nasty code I wrote ages ago is

$template = new myPHPTAL('index.html');
...
try {
  $layout -> set('content', $template->execute() );
  echo $layout->execute();
)
catch {
 smth like mail to me
}

What I found is that if I have index.html like below (yes just a HTML comment, nothing else!)
<!-- -->
that makes the whole engine to fail with some fatal exception in PHPTAL class (sorry did not save it).

The whole catch block with PHP 82 and latest PHPTAL will not execute, will crash (not even triggering catch block but maybe it is poorly written - my bad). Replacing a comment with <span></span> would make my site working again!

It used to work with PHP 5.6 and 1.3.1 PHPTAL but just upgrading to latest + PHP 8.2 made the site crash due to this "template made of a comment".

Should not behave like that?

@Ocramius
Copy link
Member

Ocramius commented Jun 1, 2024

that makes the whole engine to fail with some fatal exception in PHPTAL class (sorry did not save it).

Well, that is not valid XML, right?

I'd certainly expect an exception though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants