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
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)); } }
Dobrý den,
jedná se o chybu po čisté instalaci nebo se to stalo na již zaběhlém webu? Měnil jste případně nějakou konfiguraci nebo jste instaloval doplňky?
Dobrý den
Jedná se o čistou instalaci prestashop 1.7.7.0 . Beta 2. Přihlášení do FO ani Bo nejde. Po zadání přihlašovacích údajů formulář zamrzne a přihlášení se nezdaří. Obchod s demo daty ale funguje.
Www.1770.detsky-textil-jana.cz
Dobrý den,
možné řešení nabízejí zde: https://stackoverflow.com/questions/48140776/php-error-filter-input-expects-parameter-3-to-be-integer-string-given
Zkoušel jste případně jinou verzi PHP?
Děkuji , navrhovaná oprava skutečně problém vyřešila.
Na localhostu byla funkce bez problému s původní variantou na PHP 7,2 i 7,3.