Compare commits

...
15 changed files with 130 additions and 10 deletions
+1 -1
View File
@@ -10,8 +10,8 @@
/demo export-ignore /demo export-ignore
/docs export-ignore /docs export-ignore
/utilities export-ignore /utilities export-ignore
/docker-compose.yml export-ignore
/.github export-ignore /.github export-ignore
/.gitattributes export-ignore /.gitattributes export-ignore
/.gitignore export-ignore /.gitignore export-ignore
/make-release.sh export-ignore /make-release.sh export-ignore
-1
View File
@@ -5,7 +5,6 @@
lexer/*.php lexer/*.php
lexer/*.php.bak lexer/*.php.bak
lexer/*.out lexer/*.out
utilies/*.php
# Dev # Dev
phpunit* phpunit*
+3 -1
View File
@@ -6,8 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [4.1.1] - 2022-05-17
### Security ### Security
- Prevent PHP injection through malicious block name or include file name. This addresses CVE-2022- - Prevent PHP injection through malicious block name or include file name. This addresses CVE-2022-29221
### Fixed ### Fixed
- Exclude docs and demo from export and composer [#751](https://github.com/smarty-php/smarty/pull/751) - Exclude docs and demo from export and composer [#751](https://github.com/smarty-php/smarty/pull/751)
+39
View File
@@ -0,0 +1,39 @@
version: "2"
services:
base:
build:
context: .
volumes:
- .:/app
working_dir: /app
entrypoint: sh ./utilities/testrunners/run-test.sh
php71:
extends:
service: base
build:
dockerfile: ./utilities/testrunners/php71/Dockerfile
php72:
extends:
service: base
build:
dockerfile: ./utilities/testrunners/php72/Dockerfile
php73:
extends:
service: base
build:
dockerfile: ./utilities/testrunners/php73/Dockerfile
php74:
extends:
service: base
build:
dockerfile: ./utilities/testrunners/php74/Dockerfile
php80:
extends:
service: base
build:
dockerfile: ./utilities/testrunners/php80/Dockerfile
php81:
extends:
service: base
build:
dockerfile: ./utilities/testrunners/php81/Dockerfile
@@ -3,7 +3,7 @@
Setting `$escape_html` to TRUE will escape all template variable output Setting `$escape_html` to TRUE will escape all template variable output
by wrapping it in by wrapping it in
`htmlspecialchars({$output}, ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET);`, `htmlspecialchars({$output}, ENT_QUOTES, $char_set);`,
which is the same as `{$variable|escape:"html"}`. which is the same as `{$variable|escape:"html"}`.
Template designers can choose to selectively disable this feature by Template designers can choose to selectively disable this feature by
+6 -5
View File
@@ -5,10 +5,10 @@ Charset Encoding {#charset.encoding}
================ ================
There are a variety of encodings for textual data, ISO-8859-1 (Latin1) There are a variety of encodings for textual data, ISO-8859-1 (Latin1)
and UTF-8 being the most popular. Unless specified otherwise with the and UTF-8 being the most popular. Unless you change `Smarty::$_CHARSET`,
`SMARTY_RESOURCE_CHAR_SET` constant, Smarty recognizes `UTF-8` as the Smarty recognizes `UTF-8` as the internal charset if
internal charset if [Multibyte String](https://www.php.net/mbstring) is [Multibyte String](https://www.php.net/mbstring) is available,
available, `ISO-8859-1` if not. `ISO-8859-1` if not.
> **Note** > **Note**
> >
@@ -36,8 +36,9 @@ available, `ISO-8859-1` if not.
if (function_exists('mb_internal_charset')) { if (function_exists('mb_internal_charset')) {
mb_internal_charset('EUC-JP'); mb_internal_charset('EUC-JP');
} }
define('SMARTY_RESOURCE_CHAR_SET', 'EUC-JP');
require_once 'libs/Smarty.class.php'; require_once 'libs/Smarty.class.php';
Smarty::$_CHARSET = 'EUC-JP';
$smarty = new Smarty(); $smarty = new Smarty();
+1 -1
View File
@@ -98,7 +98,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '4.1.0'; const SMARTY_VERSION = '4.1.1';
/** /**
* define variable scopes * define variable scopes
*/ */
+10
View File
@@ -0,0 +1,10 @@
FROM php:7.1-cli
## Basic utilities
RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip
## Composer
COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh
WORKDIR /root
RUN sh ./install-composer.sh
RUN mv ./composer.phar /usr/local/bin/composer
+10
View File
@@ -0,0 +1,10 @@
FROM php:7.2-cli
## Basic utilities
RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip
## Composer
COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh
WORKDIR /root
RUN sh ./install-composer.sh
RUN mv ./composer.phar /usr/local/bin/composer
+10
View File
@@ -0,0 +1,10 @@
FROM php:7.3-cli
## Basic utilities
RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip
## Composer
COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh
WORKDIR /root
RUN sh ./install-composer.sh
RUN mv ./composer.phar /usr/local/bin/composer
+10
View File
@@ -0,0 +1,10 @@
FROM php:7.4-cli
## Basic utilities
RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip
## Composer
COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh
WORKDIR /root
RUN sh ./install-composer.sh
RUN mv ./composer.phar /usr/local/bin/composer
+10
View File
@@ -0,0 +1,10 @@
FROM php:8.0-cli
## Basic utilities
RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip
## Composer
COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh
WORKDIR /root
RUN sh ./install-composer.sh
RUN mv ./composer.phar /usr/local/bin/composer
+10
View File
@@ -0,0 +1,10 @@
FROM php:8.1-cli
## Basic utilities
RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip
## Composer
COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh
WORKDIR /root
RUN sh ./install-composer.sh
RUN mv ./composer.phar /usr/local/bin/composer
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
composer update && php ./vendor/phpunit/phpunit/phpunit
@@ -0,0 +1,17 @@
#!/bin/sh
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT