Commit Graph

1711 Commits

Author SHA1 Message Date
Simon Wisselink ad364d3138 Fixed that using count() would trigger a deprecation notice. 2024-08-14 00:43:41 +02:00
Simon Wisselink 09e211cbfd version bump 2024-05-28 23:45:58 +02:00
Simon Wisselink 76881c8d33 Merge pull request from GHSA-4rmg-292m-wg3w
* Fixed a code injection vulnerability in extends-tag

* update tests for smarty v4
2024-05-28 22:44:30 +02:00
Simon Wisselink 1115eb6f65 version bump 2024-04-06 00:33:17 +02:00
Simon Wisselink 9656f553d1 Throw deprecation notice about unregistered functions without changing the compilation flow (#985)
Fixes #964
2024-04-05 17:41:54 +02:00
Simon Wisselink 4cb00900d7 version bump 2024-03-18 15:19:05 +01:00
Simon Wisselink 1015e5472b version bump 2024-03-18 15:12:18 +01:00
Simon Wisselink c7a271323b Using unsupported PHP functions and unregistered static class methods in modifiers and expressions now triggers a deprecation notice
* Using unsupported PHP functions and unregistered static class methods in modifiers and expressions now triggers a deprecation notice because we will drop support for this in the next major release
2024-03-18 14:44:29 +01:00
Simon Wisselink 5e2a9fbb26 version bump 2024-02-26 14:56:21 +01:00
Simon Wisselink de1bc77f7f Prevent deprecation notices for implode, json_encode and substr modifiers
* Prevent deprecation notices for implode, json_encode and substr modifiers.
* unit tests
2024-02-26 14:33:47 +01:00
Simon Wisselink 326b2da8da Fix incorrect compilation of expressions when escape_html=true (#932)
Fixes #930
2024-02-05 14:37:52 +01:00
Simon Wisselink b4bbc17f1c Add PHP8.3 support for Smarty 4.3. (#927)
See #925
2024-01-23 11:45:13 +01:00
Simon Wisselink d8c1dfe56e version bump 2023-09-14 12:59:07 +02:00
Simon Wisselink 642fd69fea version bump 2023-09-14 11:00:38 +02:00
Simon Wisselink 2ff66e0fcc Fix use of negative numbers in math equations. (#904)
Fixes #895
2023-09-14 10:38:53 +02:00
Simon Wisselink d6c4274822 Fix phpdoc.
Fixes #897
2023-09-13 22:10:36 +02:00
Simon Wisselink a3cbdc46fb Fix strip_tags modifier for falsy input. (#893)
Fixes #890
2023-08-04 22:40:19 +02:00
Simon Wisselink edfd4c91da version bump 2023-07-19 12:27:34 +02:00
Simon Wisselink 4434e128c6 muteUndefinedOrNullWarnings() now also mutes PHP8 warnings for undefined properties (#891) 2023-07-19 12:27:17 +02:00
Jon 19df91b692 Remove md5 modifier from debug.tpl (#871)
* Remove `md5` modifier from debug.tpl

Replaced with a regular function call. 
See https://github.com/smarty-php/smarty/issues/813

* Move `md5()` in debug.tpl to PHP

---------

Co-authored-by: jonathan <jonathan@devrygreenhouses.com>
2023-04-30 23:25:39 +02:00
Simon Wisselink fe7817c301 version bump 2023-03-28 21:47:01 +02:00
Simon Wisselink e75165565e Implement fix and tests 2023-03-24 12:19:34 +01:00
Adrien Poupa 5988116c81 PHP 8.1 deprecation warnings on null strings in modifiers (#834) 2023-01-17 00:24:23 +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
Simon Wisselink 044647bd71 Also mute php7 notices for undefined array indexes when muteUndefinedOrNullWarnings is activated. (#829)
Fixes #736
2022-11-23 23:26:24 +01:00
Simon Wisselink 67ab8f6879 version bump 2022-11-22 22:47:30 +01:00
Simon Wisselink 773b3b4b7c Change file permissions for directories and respect umask for written files. (#828)
Fixes #548
Fixes #819
2022-11-22 22:31:54 +01:00
Hunman 613c5d691c Make SmartyCompilerException play nicer with error handler libraries (#782)
* Make SmartyCompilerException play nicer with error handler libraries

Added a new constructor, which accepts a filename and a line number too
(similar to ErrorException, except no severity parameter)
This way error handlers will display the correct file's correct line as
the source of the exception, instead of the template's line in the
core of the parser (php file)

Kept the __toString() method, but removed $source, $desc, and $template

* Revert the breaking changes
2022-11-22 21:58:13 +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
Simon Wisselink 254b5cabee Dropped remaining references to removed PHP-support in Smarty 4 from docs, lexer and security class. 2022-09-27 12:21:01 +02: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
Scott Newton 4fc39d59a5 Bug fix for underscore in template name (#581)
* Corrected bug #578, where underscore characters were being stripped from template names when using a custom resource
* Increased the maximum template name length to 127 characters when using a custom resource
2022-09-22 23:56:18 +02:00
Alec Smecher 0fb29024e7 #155 Adapt Smarty upper/lower functions to be codesafe (e.g. for Turkish locale) (#586)
* Implemented locale safe strotoupper, strolower and ucfirst functions for translating user string to filenames etc.

Fixes #155

Co-Authored-By: Alexkurd <7689609+Alexkurd@users.noreply.github.com>
2022-09-22 23:32:55 +02:00
Simon Wisselink 612bd3f657 Fixed PHP8.1 deprecation errors in strip_tags (#803) 2022-09-22 14:55:20 +02:00
Mathias b91c04bfcf Fixed PHP8.1 deprecation errors passing null to parameter in trim (#807)
Fixed a PHP 8.1 deprecation error:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in cacheresource_keyvaluestore.php on line 247 and in cacheresource_keyvaluestore.php on line 431
2022-09-22 14:29:51 +02:00
Simon Wisselink c53342c9fc Silence deprecation errors for strtime in PHP8.1 or higher
Fixes #672 (#811)
2022-09-22 14:11:36 +02:00
Jonathan Stoll 45345e75ec Fix Variable Usage (#808)
Fix Variable Usage in Exception message when unable to load subtemplate
2022-09-21 21:54:41 +02:00
Storyxx db80246b58 fix compilation for caching templates (#801) 2022-09-18 17:15:56 +02:00
Hypolite Petovan d683641f90 Fix wrong indentation in libs/plugins/modifier.capitalize.php (#802) 2022-09-18 11:14:59 +02:00
Simon Wisselink e2e68b3622 clean output buffer for Throwable instead of just Exception (#797)
Fixes #514
2022-09-14 13:47:36 +02:00
Simon Wisselink c693d81370 version bump 2022-09-14 12:58:59 +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 d304d349b4 Fixed PHP8.1 deprecation errors in capitalize modifier
Fixes #789
2022-09-13 12:19:44 +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
Simon Wisselink f8f97b4e2d Fixed PHP8.1 deprecation errors in upper modifier #788 2022-09-10 12:34:20 +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 ed454551a3 version bump 2022-08-01 23:57:36 +02:00