\phpbb\textformatter\s9e\link_helper does not correctly handle local URLs for multiple reasons:
- It doesn’t ignore www. subdomain prefix so www.example.com and example.com are treated differently
- It doesn’t ignore the protocol-part of the URL, so http://example.com, https://example.com, and //example.com are treated differently
- The call to generate_board_url() is memoized in the text formatter cache since it happens during parser configuration time, and generate_board_url() learns the board URL from the current request unless a non-standard configuration is used, so whoever visits the site and instantiates the parser for the first time after a cache clear is the one that ends up setting the “local board URL” for every future parse.
- Changing the server configuration options in ACP does not clear the text formatter cache even though this code is dependent on those options due to the generate_board_url() call.
- The truncation is handled at parse time instead of render time, so if the board settings change, URLs which are no longer local are still stored in a truncated form in the database. This also makes it impossible to fix improperly truncated URLs without reparsing the whole posts database.