laminas/laminas-escaper 2.7.1 causes error Adobe Commerce frontend and Admin pages

Affected products and versions

  • Adobe Commerce on our Cloud Architecture 2.3.5+
  • Adobe Commerce 2.3.5+

Issue

After the update to laminas/laminas-escaper:2.7.1 an error message is displayed on the page.

Steps to reproduce:

Update laminas/laminas-escaper to 2.7.1.

Expected result:

No error.

Actual result:

After update to laminas/laminas-escaper:2.7.1 an error message is displayed on a product edit (or product management) page: TypeError: rawurlencode() expects parameter 1 to be string, int given in /var/www/magento/vendor/laminas/laminas-escaper/src/Escaper.php:246
This error occurs on the frontend and Admin pages causing the content of the page to be distorted.

Cause

laminas/laminas-escaper 2.7.1 started using strict type validation for the Escaper class.

Solution

Run composer require laminas/laminas-escaper:2.7.0 in the root directory of each project.

laminas Documentation: laminas-escaper

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a