Skip to content

PHP 8.2+: mb_convert_encoding(..., 'HTML-ENTITIES') in Html2Text.php breaks bugnote submission via REST API (HTTP 500) #8

Description

@anthony5301

Environment

  • VEditor: 1.1.2
  • MantisBT: 2.28.3 (also reproduced on 2.28.0; present throughout 2.28.x)
  • PHP: 8.3.31 (mod_php / Apache)

Summary

With VEditor enabled, submitting a bugnote (or any text VEditor processes)
through MantisBT's REST API fails with HTTP 500 on PHP 8.2+.

Root cause

src/Html2Text.php:54:

$html = mb_convert_encoding($html, "HTML-ENTITIES", "UTF-8");

It will only crash on REST api because api/rest/index.php:

set_error_handler( 'deprecated_errors_handler', E_DEPRECATED );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions