Homestyx hydra
Diffusion hydra fe1122bd4d6d

Catch RuntimeException: mb_convert_encoding(): Illegal character encoding…

Description

Catch RuntimeException: mb_convert_encoding(): Illegal character encoding specified at PhabricatorTextDocumentEngine.php:73

Summary:
When given $encoding is invalid, catch the exception to show a proper error message and make the server logs provide more hints.

EXCEPTION: (RuntimeException) mb_convert_encoding(): Illegal character encoding specified at [<arcanist>/src/error/PhutilErrorHandler.php:261]
#0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
#1 <#2> mb_convert_encoding(string, string, string) called at [<phabricator>/src/applications/files/document/PhabricatorTextDocumentEngine.php:73]

Closes T15624

Test Plan: Open a URL which passes a bogus encoding value as parameter, like /source/somerepository/browse/master/README.md?as=source&encode=TROLOLOL

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: Sten, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15624

Differential Revision: https://we.phorge.it/D25418

Details

Provenance
Andre KlapperAuthored on Dec 17 2023, 5:41 AM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:2295bcda14e7: Curtain: add Hovercard support
Branches
Unknown
Tags
Unknown

Event Timeline