HTML parsing on Alpine Linux
As discussed on Support Forum (https://node9.org/channel/michal/?f=&mid=b64.aHR0cHM6Ly9ub2RlOS5vcmcvaXRlbS82YzNiZTUxYi0zNjA3LTQzMTgtODJlYS1hNGY4ZjJkNzU0YmY) i want to write here for some conclusion
On Alpine Linux (frequently used in Docker/containerised environments) when the scrape_vcard() in Network.php parses the DOM through HTML5 lib, getElementsByTagName received are just html, head, body, which in result leads to not finding Public key of the author, discarding post, updating profile with default icons etc.
Image used: php:7.3-fpm-alpine
PHP version, XML extensions, all OK
calling standard PHP $dom->loadHTMLFile( $url) fixed the problem and worked well.
Anyway it would not fix Hubzilla behavior using HTML5 lib on other places, so i have rebuilt the image
Image used: php:7.4-fpm
based on Debian Buster, adding the needed extensions and the problem is not present.
So the problem can be in compilation of some PHP extension on Alpine: not linked underline libraries, not using GlibC (maybe mbstring - Oniguruma or something like this)
The conclusion could be:
- update documentation, like suggested PHP image to use
- warning on extension functionality not present
- show parsing error with PHP compatibility warning in logs