Commit Graph

69 Commits

Author SHA1 Message Date
Simon Wisselink
536721d457 Removed the allowUndefinedVars check from the smarty error handlers, because undefined vars no longer throw an error, unless smarty->error_unassigned is set to true. 2023-01-12 09:59:10 +01:00
Simon Wisselink
577f910e49 removed phpplugin, removed now unused uncompiled handler and all checks for this, fixed a refactorbug in InheritanceRuntime. Moved getRenderedTemplateCode method to Smarty\Template. Renamed Cache en Compiled base class to GeneratedPhpFile for more clarity and distinction from Resource classes. Inlined Cached::create into its only caller. Some other minor improvements. Removed php7.1 CI tests. 2023-01-11 23:33:12 +01:00
Simon Wisselink
22ce23b47b Made variable scoping more sensible 2023-01-11 11:22:24 +01:00
Simon Wisselink
ad245ccd0c Fixed minor unit tests 2023-01-11 00:00:07 +01:00
Simon Wisselink
51075e0421 WIP fixing the complicated variables scopes architecture. Right now more tests are failing than before... :( 2023-01-10 23:49:33 +01:00
Simon Wisselink
3d10630510 WIP rewriting variable scopes 2023-01-10 17:35:34 +01:00
Simon Wisselink
9651dafbce WIP replacing direct access tpl_vars with proper getter/setters. 2023-01-10 14:46:33 +01:00
Simon Wisselink
e124f71dd8 Fixed issue related to scoping of left/right delimiter overrides 2023-01-09 11:25:09 +01:00
Simon Wisselink
34d5d6d024 Rewrote global static global_tpl_vars to getters/setters on Smarty class, fixing several test cases. Added a ::getValue() method to Variable. 2023-01-09 09:55:22 +01:00
Simon Wisselink
861aafa92c 2 small fixes for unit tests 2023-01-07 23:45:59 +01:00
Simon Wisselink
fd64cc688a Removed PHP functions and checks for the already removed php modifiers. Re-implemented functions as regular functions. Probably should compile these directly. 2023-01-07 23:06:47 +01:00
Simon Wisselink
e595cd2a5d Fixed BC loading of resource pluging from dir and all ResourcePluginTest tests 2023-01-06 21:53:37 +01:00
Simon Wisselink
b2e11ee2b8 Removed deprecated extends_recursion property and fix bug in CodeFrame compiler due to use of clone. 2023-01-06 21:43:48 +01:00
Simon Wisselink
f07e342d61 Removed now unneeded PHPunit annotations @run(Tests)InSeparateProcess, @preserveGlobalState and @backupStaticAttributes. Made CacheResourceTestCommon abstract to prevent the base class from running tests (and always failing). Unregister a previously registered stream wrapper. Fixes a lot of tests. 2023-01-05 23:06:02 +01:00
Simon Wisselink
576bd4cc01 Removed support for PHP include path, and removed the ::loadPlugin method. 2023-01-05 21:58:29 +01:00
Simon Wisselink
e89a3dda49 Implemented the DefaultHandlerBlockCompiler, made the dependencies of the template compiler into properties, fixed a couple of unit tests 2023-01-05 11:18:42 +01:00
Simon Wisselink
3cc61133a3 Fix code duplication in block compilers and fix (most) BlockPluginTests. Default plugin handler blocks still need fixing. 2023-01-04 23:45:57 +01:00
Simon Wisselink
41054cfb05 Fixed DefaultPluginHandlerTest for function plugins (blocks still break) 2023-01-04 12:16:10 +01:00
Simon Wisselink
16c7fe1d4f Fixed setfilter 2023-01-03 22:03:43 +01:00
Simon Wisselink
3fccb54093 Fixed CacheResource implementation and tests 2023-01-03 17:10:02 +01:00
Simon Wisselink
98ad1a13af Fixed TemplateObject test 2023-01-03 14:20:40 +01:00
Simon Wisselink
9766aba66e filter tests passing 2023-01-03 14:12:36 +01:00
Simon Wisselink
b9ecf115dd fixed pre/post/output filters and removed some old todo-comments 2023-01-02 23:26:36 +01:00
Simon Wisselink
60a56969dd WIP moving Smarty to PSR-4. 2023-01-02 00:49:38 +01:00
Simon Wisselink
ab5705a90d Rewrote all default modifiers and functions from the plugins folder to PSR-4 classes 2022-12-24 23:38:13 +01:00
Simon Wisselink
57cff64869 Add makefile, PSR-4 ModifierCompilers 2022-12-23 14:03:05 +01:00
Simon Wisselink
4d66910e7f Entire src dir now PSR-4 compatible 2022-12-22 22:38:37 +01:00
Simon Wisselink
f1e7b2d46f src/sysplugins/* to PSR-4 2022-12-22 21:50:01 +01:00
Simon Wisselink
0fc2b3726b src/Template/* to PSR-4 2022-12-22 21:23:22 +01:00
Simon Wisselink
cfd8c08d09 smarty_internal_resource_* to PSR-4 2022-12-21 16:33:26 +01:00
Simon Wisselink
164a89a1fd WIP making compile classes PSR-4 2022-12-01 23:44:58 +01:00
Simon Wisselink
d0319bdc87 Replace Smarty:: with symfony/polyfill-mbstring 2022-12-01 21:56:12 +01:00
Simon Wisselink
e54a53332f Removed autoload filters 2022-11-30 10:06:09 +01:00
Simon Wisselink
8b5540f4f3 More PSR4 rewriting 2022-11-30 00:25:27 +01:00
Simon Wisselink
91b6fdeb4e WIP converting code to PSR-4 2022-11-28 12:30:07 +01:00
Simon Wisselink
a34ee98e21 Allow dereferencing of non-objects accross all supported PHP versions (#832)
Fixes #831
2022-11-24 18:44:19 +01:00
Simon Wisselink
c0a6b641bf Treat undefined vars and array access of a null or false variables equivalent across all supported PHP versions (#830)
* Added test to see what changed exactly

* Treat undefined vars and array access of a null or false variables
  equivalent across all supported PHP versions

* Removed 2 tests that produce inconsistent results between PHP7.x versions.

* Fix regex matching for slightly different error message for php7.1
2022-11-24 09:43:51 +01:00
Progi1984
c016895166 PHP8.2 compatibility (#775)
* PHP8.2 compatibility

* PHP8.2 compatibility : Fixed unit tests

* PHP8.2 compatibility : Replace ENT_COMPAT by ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401

* PHP8.2 compatibility : Remove deprecated utf8_decode

* PHP8.2 compatibility : Remove HTML-ENTITIES parameter

* Removed some unused code for clarity, updated the changelog.

* More concise escape implementation and unit test to cover both modifierplugin and modifiercompiler.

* Fix htmlall unescape of quotes without mbstring too

Co-authored-by: Simon Wisselink <s.wisselink@iwink.nl>
2022-11-22 21:22:57 +01:00
Raimondas Rimkevičius
1b556c7077 Use __DIR__ instead of dirname(__FILE__) (#817) 2022-09-27 12:03:34 +02:00
Simon Wisselink
4550fc0339 Using PHP functions as modifiers now triggers a deprecation notice (#814)
Fixes #813
2022-09-23 00:09:00 +02:00
Simon Wisselink
813c83f7a3 Fixed unselected year/month/day not working in html_select_date
Fixes #395
2022-09-14 12:44:37 +02:00
Simon Wisselink
55ea25d1f5 Applied appropriate javascript and html escaping in mailto plugin to counter injection attacks
Fixes #454
2022-09-14 11:38:18 +02:00
Simon Wisselink
5479e3362c Fixed use of rand() without a parameter in math function (#795)
* Fixed use of `rand()` without a parameter in math function
Fixes #794
2022-09-12 12:13:42 +02:00
Mark Fettig
1bc7c722a3 address PHP 8.1 'explode', 'number_format', and 'replace' deprecations (#755) 2022-09-09 22:39:24 +02:00
Simon Wisselink
f4b26a3cbf Fixed second param of unescape modifier (#778)
Fixes #777
2022-08-01 23:49:19 +02:00
Simon Wisselink
20a8026ccd Merge branch 'fix-issue-549-v3' of github.com:AnrDaemon/smarty into AnrDaemon-fix-issue-549-v3 (#771) 2022-07-19 22:55:07 +02:00
Jorge Sá Pereira
962f266483 Fix PHP 8.1 deprecated warning when calling rtrim
Fixes - Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated
2022-03-10 02:06:00 +00:00
Pavel Kochman
02633ecaba math equation return warning: math: illegal character for : {math equation="max(x, y)" x=$x y=$y} 2022-02-04 21:03:25 +01:00
Thomas BACCELLI
323aefa89f Fix phpunit warning 2022-01-18 15:56:23 +01:00
Thomas A. Hirsch
8d3a7af308 Cherry-picked from da76d927ed
Co-Authored-By: Thomas BACCELLI <tbaccelli@gmail.com>
2022-01-18 15:56:23 +01:00