Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Uncaught ErrorException: "iconv(): Detected an incomplete multibyte character in input string" #112

@brandonkelly

Description

@brandonkelly

If you go to a URL with an incomplete multibyte character in the URI, an error will occur that Retour doesn’t catch.

Steps to reproduce:

  1. Have Retour installed
  2. Go to /test%F2%FB

Expected behavior:

404 error

Actual:

A 500 response is given, with this in the logs:

2019-02-20 03:32:21 [-][18][msol1tbrqs5l93vb53nifir9bm][error][yii\base\ErrorException:1] yii\base\ErrorException: Uncaught yii\base\ErrorException: iconv(): Detected an incomplete multibyte character in input string in /var/app/current/vendor/nystudio107/craft-retour/src/helpers/Text.php:91
Stack trace:
#0 /var/app/current/vendor/craftcms/cms/src/web/ErrorHandler.php(76): yii\base\ErrorHandler->handleError(8, 'iconv(): Detect...', '/var/app/curren...', 91)
#1 [internal function]: craft\web\ErrorHandler->handleError(8, 'iconv(): Detect...', '/var/app/curren...', 91, Array)
#2 /var/app/current/vendor/nystudio107/craft-retour/src/helpers/Text.php(91): iconv('', 'UTF-8//IGNORE', '/testfooo\xF2\xFB')
#3 /var/app/current/vendor/nystudio107/craft-retour/src/validators/DbStringValidator.php(52): nystudio107\retour\helpers\Text::cleanupText('/testfooo\xF2\xFB')
#4 /var/app/current/vendor/yiisoft/yii2/validators/Validator.php(267): nystudio107\retour\validators\DbStringValidator->validateAttribute(Object(nystudio107\retour\models\Stats), 'redirectSrcUrl')
#5 /var/app/current/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\ in /var/app/current/vendor/nystudio107/craft-retour/src/helpers/Text.php:91
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}
2019-02-20 03:32:20 [-][18][msol1tbrqs5l93vb53nifir9bm][info][application] $_GET = [
    'p' => 'test�'
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions