In PHP 8.1, htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entitity_decode() and get_html_translation_table() now use ENT_QUOTES | ENT_SUBSTITUTE rather than ENT_COMPAT by default. This means that ' is escaped to ' while previously it was left alone.
See https://github.com/php/php-src/commit/50eca61f68815005f3b0f808578cc1ce3b4297f0
This changes phpBB's email handling and other cases involving respective functions on PHP 8.1 and causes at least function make_clickable() test failure. See https://github.com/phpbb/phpbb/pull/6128/checks?check_run_id=1728479510