smarty icon indicating copy to clipboard operation
smarty copied to clipboard

Fixed render crash when using inline include with a string template

Open wisskid opened this issue 4 years ago • 7 comments

Fixes #639

wisskid avatar Mar 22 '21 09:03 wisskid

@AnrDaemon have a look please?

wisskid avatar Mar 22 '21 09:03 wisskid

Had one. There's at least two issues with this PR.

  1. It evaluates incorrectly (see modified unit test in #652 ).
  2. It does not cover the regression reported (see specific regression test in the same PR).

AnrDaemon avatar Mar 22 '21 19:03 AnrDaemon

so... is the fuss about the newline or about the fatal error?

wisskid avatar Mar 22 '21 22:03 wisskid

Now it is about different rendering result before and after the fix.

There's no more crashes as far as I can see.

AnrDaemon avatar Mar 23 '21 07:03 AnrDaemon

OK, but In my experience there was always a fatal error when rendering a string template inline. I see the extra newline in the output, but wouldn't that be a separate, somewhat less important issue? Also: why would one render a string template as inline?

wisskid avatar Mar 23 '21 09:03 wisskid

string: source was used to easily demonstrate the issue using as few extra files as possible. In real world, it was indeed an external file, but I made sure the results are exactly same.

AnrDaemon avatar Mar 23 '21 16:03 AnrDaemon

To clarify: I've never had crashes with string:… inline alone.

AnrDaemon avatar Mar 23 '21 16:03 AnrDaemon