Git Product home page Git Product logo

Comments (5)

Stricted avatar Stricted commented on July 1, 2024

looks like https://github.com/smarty-php/smarty/blob/master/libs/sysplugins/smarty_internal_templatecompilerbase.php#L521 is the problem

echo substr($tag, - 5); above this line says 'close'
if you look at line https://github.com/smarty-php/smarty/blob/master/libs/sysplugins/smarty_internal_templatecompilerbase.php#L638 you see that the 'close' will be removed and then it will trigger the error becouse your plugin has the name 'testclose' and not 'test'

i think @uwetews need to check this

from smarty.

uwetews avatar uwetews commented on July 1, 2024

Smarty does use tag names ending with close internally to handle closing tags. Like {/foo} => fooclose.
You should not use it as a standalone plugin name.

It allows for example to write compiler plugins for block tags usage. One compiler plugin 'foo' and one for 'fooclose' to use {foo} .... {/foo}.

from smarty.

calguy1000 avatar calguy1000 commented on July 1, 2024

Well, the problem is that older versions of smarty (2.x) didn't do that...
and there are valid cases where people have written smarty plugins for
various third party packages using smarty with the name 'close' in them,
and those plugins are years old...... maybe they could have used a block
tag, but they didn't. i.e: tags like {form_open} or {form_close} or
{togglearea_open} and {togglearea_close}

And now those plugins cause an error in smarty 3.

Is it possible to change smarty in the next version to use a delimiter
like: "_smartyclose" or something that is less likely to conflict with
valid tag names.

On Thu, Jun 11, 2015 at 1:06 PM, uwetews [email protected] wrote:

Smarty does use tag names ending with close internally to handle closing
tags. Like {/foo} => fooclose.
You should not use it as a standalone plugin name.

It allows for example to write compiler plugins for block tags usage. One
compiler plugin 'foo' and one for 'fooclose' to use {foo} .... {/foo}.


Reply to this email directly or view it on GitHub
#52 (comment).

from smarty.

uwetews avatar uwetews commented on July 1, 2024

If I do that Smarty 3 users which have written compiler plugins for closing tags will get errors.
What I can do is to handle tags ending with "_close" like normal plugins tag.

from smarty.

uwetews avatar uwetews commented on July 1, 2024

This problem is now resolved.
Function plugins can now have names ending with 'close'.
The fix is in dev-master and will later be included in the 3.1.28 release.

from smarty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.