přihlášení do prestashopu nefunguje
Dobrý den
v instalaci Prestashop se nelze přihlásit a v logu je tato chyba:
- request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: „Type error: idn_to_utf8() expects parameter 3 to be integer, string given“ at /data/web/virtuals/76383/virtual/www/domains/1770.detsky-textil-jana.cz/src/Core/Util/InternationalizedDomainNameConverter.php line 47 {„exception“:“[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Type error: idn_to_utf8() expects parameter 3 to be integer, string given at /data/web/virtuals/76383/virtual/www/domains/1770.detsky-textil-jana.cz/src/Core/Util/InternationalizedDomainNameConverter.php:47)“} []
Ćím by mohla být způsobena?
Děkuji Hladěna
Role: Zákazník
Otázka je uzamčena pro nové odpovědi.
MN270053 Vybral nejlepší odpověď 6. 12. 2020
5 Answers
Podle dostupných informací by mělo být řešením použití PHP 7.4, ale to zatím není dostupné.
Pro PHP 7.3 je řešením změna v souboru „src/Core/Util/InternationalizedDomainNameConverter.php“ na řádku 47.
Musí se přetypovat konstanta INTL_IDNA_VARIANT_UTS46, která je variant na integer použitím funkce intval(), viz změna níže:
<?php /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors <contact@prestashop.com> * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\PrestaShop\Core\Util; class InternationalizedDomainNameConverter { /** * Convert the host part of the email from punycode to utf8 (e.g,. email@xn--e1aybc.xn--p1ai -> email@тест.рф) * * @param string $email * * @return string */ public function emailToUtf8(string $email): string { $parts = explode('@', $email); if (count($parts) !== 2) { return $email; } return $parts[0] . '@' . idn_to_utf8($parts[1], 0, intval(INTL_IDNA_VARIANT_UTS46)); } }
Role: Zákazník
MN270053 Vybral nejlepší odpověď 6. 12. 2020