Commit Graph

72 Commits

Author SHA1 Message Date
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
Claas Augner
059bea274c Support multiple operators in math equations (#708)
* fix(math): fix equation regexp

Fixes #702.
2022-01-18 00:10:17 +01:00
Simon Wisselink
19ae410bf5 Merge pull request from GHSA-4h9c-v5vg-5m6m
* Prevent evasion of the static_classes security policy.

* Updated deprecated exception expectations.
2022-01-10 10:48:27 +01:00
Simon Wisselink
baad3115cd Fixed PHPUnit expected Exceptions. (#701) 2022-01-10 09:46:01 +01:00
Simon Wisselink
215d81a9fa Merge pull request from GHSA-29gp-2c3m-3j6m
* Temporary fix. Waiting for CVE

* Add CVE
2022-01-10 00:01:43 +01:00
Simon Wisselink
efb416e5ef Fixed unit tests 2022-01-09 23:29:43 +01:00
Simon Wisselink
39b69f0142 Feature/php8 support (#629)
Adds support for PHP8.0, dropping support for PHP7.0 and below.

Backwards incompatible changes:
- Dropped support for php asp tags in templates (removed from php since php7.0)
- Dropped deprecated API calls that where only accessible through SmartyBC
- Dropped support for {php} and {include_php} tags and embedded PHP in templates. Embedded PHP will now be passed through as is.
- Removed all PHP_VERSION_ID and compare_version checks and conditional code blocks that are now no longer required
- Dropped deprecated SMARTY_RESOURCE_CHAR_SET and SMARTY_RESOURCE_DATE_FORMAT constants
- Dropped deprecated Smarty::muteExpectedErrors and Smarty::unmuteExpectedErrors API methods
- Dropped deprecated $smarty->getVariable() method. Use $smarty->getTemplateVars() instead.
- $smarty->registerResource() no longer accepts an array of callback functions

See the changelog for more details.

Switched CI from Travis to Github CI.
2021-10-13 12:15:17 +02:00
Simon Wisselink
4f634c0097 Merge branch 'bugfix/tplfunction_sandbox_escape' 2021-02-17 22:52:34 +01:00
Simon Wisselink
8fc66e27a7 Cannot use in Smarty3 yet, revert to @expectedException 2021-02-01 10:33:00 +01:00
Simon Wisselink
2543174460 Cannot use in Smarty3 yet, revert to @expectedException 2021-02-01 10:31:20 +01:00
Simon Wisselink
288a54f6b0 Add unit test 2021-01-24 23:52:45 +01:00
Simon Wisselink
165f1bd4d2 Fixed Code injection vulnerability by using illegal function names 2021-01-24 23:44:07 +01:00
Simon Wisselink
fedc127057 Mark tests that use sleep calls as slow, so we can ignore them when running unit tests in development 2021-01-16 23:01:15 +01:00
Ikko Ashimine
3af2df20a4 Fix typo in StreamVariableTest.php (#616)
existant -> existent
2021-01-08 17:28:33 +01:00
Simon Wisselink
c295786e43 Fixes for php8.0.0beta3 (#608)
* Set $errcontext argument optional to support PHP 8

- Argument is optional and deprecated in PHP 7.2

* Getting ready for PHP8, handling changed error levels/handlers mostly

* php5 compat syntax

* Updated UndefinedTemplateVarTest for PHP8 (and disabled a check for PHP<5.6) and re-enabled php:nightly in travis config

* Attempt to fix travis runs for (almost) all php versions supported

* Fix unit tests for php8, force composer to think we are still php7 to pick a supported phpunit and being less specific about an error msg because PHP8 is in active development and the exact wording is changing.

* Fixed a unit test that accidentally passed on phpunit < 7 because of sloppy string comparison.

* changelog

* run travis in xenial where possible for latest php versions. Fix unit tests from freakingo over inconsistent error messages in php8-beta.

* Incorporated AnrDaemons suggestions, making composer figure out the required phpunit version instead of specifying it explicitly and removing a unneeded error supression (@).

Co-authored-by: Jorge Sá Pereira <me@jorgesapereira.com>
2020-09-12 21:37:31 +02:00
Simon Wisselink
a5934a755d Fixed a unit test that accidentally passed on phpunit < 7 because of sloppy string comparison. 2020-09-11 13:22:45 +02:00
AnrDaemon
eae19f23b9 PHP 5.3 compatibility fixes 2020-05-05 01:37:36 +03:00
Simon Wisselink
290f7cfc3d Moved the isset tests into the test suite 2020-04-13 23:44:39 +02:00
Simon Wisselink
19ef8342aa Strip now removes whitespaces after comment (#582)
* Mark text sections as to be stripped, but do not strip them right away. Combine equivalent sections in chunks at the template level and strip combined chunks where possible.
- simplified Smarty_Internal_TemplateCompilerBase::processText along the way
Fixes #447
2020-04-13 22:27:42 +02:00
Simon Wisselink
17d4d43624 Feature/merge smarty-phpunit into tests subfolder (#580)
* Removed unneeded files and replace dummy.txt with .gitignore files
* Synced unit tests with master codebase, noted TODO's, fixed phpunit scripts and travis config
* fix php7.4 deprecation and remove php7.4 from travis allow_failures since php7.4 is current stable

Co-authored-by: Uwe Tews <uwe.tews@googlemail.com>
Co-authored-by: Uwe Tews <uwe.tews@gmail.com>
Co-authored-by: AnrDaemon <anrdaemon@yandex.ru>
2020-04-13 15:30:52 +02:00