mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
PHP8.2 compatibility
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -31,6 +31,7 @@ jobs:
|
|||||||
- "7.4"
|
- "7.4"
|
||||||
- "8.0"
|
- "8.0"
|
||||||
- "8.1"
|
- "8.1"
|
||||||
|
- "8.2"
|
||||||
|
|
||||||
compiler:
|
compiler:
|
||||||
- default
|
- default
|
||||||
@@ -42,6 +43,9 @@ jobs:
|
|||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
php-version: "8.1"
|
php-version: "8.1"
|
||||||
compiler: jit
|
compiler: jit
|
||||||
|
- os: ubuntu-latest
|
||||||
|
php-version: "8.2"
|
||||||
|
compiler: jit
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@@ -7,7 +7,7 @@ Smarty is a template engine for PHP, facilitating the separation of presentation
|
|||||||
Read the [documentation](https://smarty-php.github.io/smarty/) to find out how to use it.
|
Read the [documentation](https://smarty-php.github.io/smarty/) to find out how to use it.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
Smarty can be run with PHP 7.1 to PHP 8.1.
|
Smarty can be run with PHP 7.1 to PHP 8.2.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/).
|
Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/).
|
||||||
|
@@ -38,3 +38,8 @@ services:
|
|||||||
service: base
|
service: base
|
||||||
build:
|
build:
|
||||||
dockerfile: ./utilities/testrunners/php81/Dockerfile
|
dockerfile: ./utilities/testrunners/php81/Dockerfile
|
||||||
|
php82:
|
||||||
|
extends:
|
||||||
|
service: base
|
||||||
|
build:
|
||||||
|
dockerfile: ./utilities/testrunners/php82/Dockerfile
|
||||||
|
@@ -2,7 +2,7 @@ What is Smarty?
|
|||||||
==============
|
==============
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
Smarty can be run with PHP 7.1 to PHP 8.1.
|
Smarty can be run with PHP 7.1 to PHP 8.2.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/).
|
Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/).
|
||||||
|
@@ -54,13 +54,13 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile
|
|||||||
if (Smarty::$_MBSTRING) {
|
if (Smarty::$_MBSTRING) {
|
||||||
if ($_double_encode) {
|
if ($_double_encode) {
|
||||||
// php >=5.2.3 - go native
|
// php >=5.2.3 - go native
|
||||||
return 'mb_convert_encoding(htmlspecialchars((string)' . $params[ 0 ] . ', ENT_QUOTES, ' .
|
return 'htmlspecialchars_decode(mb_convert_encoding(htmlentities(htmlspecialchars((string)' . $params[ 0 ] . ', ENT_QUOTES, ' .
|
||||||
var_export($char_set, true) . ', ' . var_export($double_encode, true) .
|
var_export($char_set, true) . ', ' . var_export($double_encode, true) .
|
||||||
'), "HTML-ENTITIES", ' . var_export($char_set, true) . ')';
|
'), ENT_COMPAT, ' . var_export($char_set, true) . '),' . var_export($char_set, true) . '))';
|
||||||
} elseif ($double_encode) {
|
} elseif ($double_encode) {
|
||||||
// php <5.2.3 - only handle double encoding
|
// php <5.2.3 - only handle double encoding
|
||||||
return 'mb_convert_encoding(htmlspecialchars((string)' . $params[ 0 ] . ', ENT_QUOTES, ' .
|
return 'htmlspecialchars_decode(mb_convert_encoding(htmlentities(htmlspecialchars((string)' . $params[ 0 ] . ', ENT_QUOTES, ' .
|
||||||
var_export($char_set, true) . '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')';
|
var_export($char_set, true) . '), ENT_COMPAT, ' . var_export($char_set, true) . '), ' . var_export($char_set, true) . '))';
|
||||||
} else {
|
} else {
|
||||||
// fall back to modifier.escape.php
|
// fall back to modifier.escape.php
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
* @property Smarty_Internal_Method_RegisterPlugin $registerPlugin
|
* @property Smarty_Internal_Method_RegisterPlugin $registerPlugin
|
||||||
* @property mixed|\Smarty_Template_Cached configLoad
|
* @property mixed|\Smarty_Template_Cached configLoad
|
||||||
*/
|
*/
|
||||||
|
#[\AllowDynamicProperties]
|
||||||
class Smarty_Internal_Extension_Handler
|
class Smarty_Internal_Extension_Handler
|
||||||
{
|
{
|
||||||
public $objType = null;
|
public $objType = null;
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
*
|
*
|
||||||
* @method bool mustCompile()
|
* @method bool mustCompile()
|
||||||
*/
|
*/
|
||||||
|
#[\AllowDynamicProperties]
|
||||||
class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
/**
|
/**
|
||||||
* This class does contain the security settings
|
* This class does contain the security settings
|
||||||
*/
|
*/
|
||||||
|
#[\AllowDynamicProperties]
|
||||||
class Smarty_Security
|
class Smarty_Security
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage Template
|
* @subpackage Template
|
||||||
*/
|
*/
|
||||||
|
#[\AllowDynamicProperties]
|
||||||
class Smarty_Variable
|
class Smarty_Variable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
10
utilities/testrunners/php82/Dockerfile
Normal file
10
utilities/testrunners/php82/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM php:8.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
|
Reference in New Issue
Block a user