diff --git a/admin/framework/composer.json b/admin/framework/composer.json index 3b047c89fc35..627ea1d48087 100644 --- a/admin/framework/composer.json +++ b/admin/framework/composer.json @@ -1,5 +1,5 @@ { - "name": "codeigniter4/framework", + "name": "codeigniter4/codeigniter4", "type": "project", "description": "The CodeIgniter framework v4", "homepage": "https://codeigniter.com", @@ -8,9 +8,10 @@ "php": ">=7.2", "ext-curl": "*", "ext-intl": "*", + "ext-json": "*", "kint-php/kint": "^2.1", "psr/log": "^1.1", - "zendframework/zend-escaper": "^2.5" + "laminas/laminas-escaper": "^2.6" }, "require-dev": { "codeigniter4/codeigniter4-standard": "^1.0", @@ -26,7 +27,8 @@ "scripts": { "post-update-cmd": [ "@composer dump-autoload", - "CodeIgniter\\ComposerScripts::postUpdate" + "CodeIgniter\\ComposerScripts::postUpdate", + "bash admin/setup.sh" ] }, "support": { diff --git a/composer.json b/composer.json index 5f6bfdc286d1..627ea1d48087 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "ext-json": "*", "kint-php/kint": "^2.1", "psr/log": "^1.1", - "zendframework/zend-escaper": "^2.5" + "laminas/laminas-escaper": "^2.6" }, "require-dev": { "codeigniter4/codeigniter4-standard": "^1.0", diff --git a/system/Common.php b/system/Common.php index d4ecc3498342..f530658e730f 100644 --- a/system/Common.php +++ b/system/Common.php @@ -48,7 +48,7 @@ use Config\Logger; use Config\Services; use Tests\Support\Log\TestLogger; -use Zend\Escaper\Escaper; +use Laminas\Escaper\Escaper; /** * Common Functions diff --git a/system/ComposerScripts.php b/system/ComposerScripts.php index 6cf41f92968b..3a3c4d3b22be 100644 --- a/system/ComposerScripts.php +++ b/system/ComposerScripts.php @@ -150,16 +150,16 @@ protected static function removeDir($dir) } /** - * Moves the Zend Escaper files into our base repo so that it's + * Moves the Laminas Escaper files into our base repo so that it's * available for packaged releases where the users don't user Composer. * * @throws \ReflectionException */ public static function moveEscaper() { - if (class_exists('\\Zend\\Escaper\\Escaper') && is_file(static::getClassFilePath('\\Zend\\Escaper\\Escaper'))) + if (class_exists('\\Laminas\\Escaper\\Escaper') && is_file(static::getClassFilePath('\\Laminas\\Escaper\\Escaper'))) { - $base = basename(__DIR__) . '/' . static::$basePath . 'ZendEscaper'; + $base = basename(__DIR__) . '/' . static::$basePath . 'Escaper'; foreach ([$base, $base . '/Exception'] as $path) { @@ -170,10 +170,10 @@ public static function moveEscaper() } $files = [ - static::getClassFilePath('\\Zend\\Escaper\\Exception\\ExceptionInterface') => $base . '/Exception/ExceptionInterface.php', - static::getClassFilePath('\\Zend\\Escaper\\Exception\\InvalidArgumentException') => $base . '/Exception/InvalidArgumentException.php', - static::getClassFilePath('\\Zend\\Escaper\\Exception\\RuntimeException') => $base . '/Exception/RuntimeException.php', - static::getClassFilePath('\\Zend\\Escaper\\Escaper') => $base . '/Escaper.php', + static::getClassFilePath('\\Laminas\\Escaper\\Exception\\ExceptionInterface') => $base . '/Exception/ExceptionInterface.php', + static::getClassFilePath('\\Laminas\\Escaper\\Exception\\InvalidArgumentException') => $base . '/Exception/InvalidArgumentException.php', + static::getClassFilePath('\\Laminas\\Escaper\\Exception\\RuntimeException') => $base . '/Exception/RuntimeException.php', + static::getClassFilePath('\\Laminas\\Escaper\\Escaper') => $base . '/Escaper.php', ]; foreach ($files as $source => $dest) diff --git a/system/Config/AutoloadConfig.php b/system/Config/AutoloadConfig.php index 57dd92e7a595..9902c17e64cf 100644 --- a/system/Config/AutoloadConfig.php +++ b/system/Config/AutoloadConfig.php @@ -124,7 +124,7 @@ public function __construct() 'Psr\Log\LoggerTrait' => SYSTEMPATH . 'ThirdParty/PSR/Log/LoggerTrait.php', 'Psr\Log\LogLevel' => SYSTEMPATH . 'ThirdParty/PSR/Log/LogLevel.php', 'Psr\Log\NullLogger' => SYSTEMPATH . 'ThirdParty/PSR/Log/NullLogger.php', - 'Zend\Escaper\Escaper' => SYSTEMPATH . 'ThirdParty/ZendEscaper/Escaper.php', + 'Laminas\Escaper\Escaper' => SYSTEMPATH . 'ThirdParty/Escaper/Escaper.php', ]; if (isset($_SERVER['CI_ENVIRONMENT']) && $_SERVER['CI_ENVIRONMENT'] === 'testing') diff --git a/system/ThirdParty/ZendEscaper/Escaper.php b/system/ThirdParty/Escaper/Escaper.php similarity index 97% rename from system/ThirdParty/ZendEscaper/Escaper.php rename to system/ThirdParty/Escaper/Escaper.php index 5cec9684ef46..9f903a5931a5 100644 --- a/system/ThirdParty/ZendEscaper/Escaper.php +++ b/system/ThirdParty/Escaper/Escaper.php @@ -1,13 +1,12 @@ loader->initialize($config, $moduleConfig); $namespaces = $this->loader->getNamespace(); - $this->assertArrayHasKey('Zend\\Escaper', $namespaces); + $this->assertArrayHasKey('Laminas\\Escaper', $namespaces); } } diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst index 0c9b54fbdb39..088018e1a283 100755 --- a/user_guide_src/source/general/common_functions.rst +++ b/user_guide_src/source/general/common_functions.rst @@ -56,7 +56,7 @@ Service Accessors :rtype: mixed Escapes data for inclusion in web pages, to help prevent XSS attacks. - This uses the Zend Escaper library to handle the actual filtering of the data. + This uses the Laminas Escaper library to handle the actual filtering of the data. If $data is a string, then it simply escapes and returns it. If $data is an array, then it loops over it, escaping each 'value' of the key/value pairs.