htmlpurifier
htmlpurifier copied to clipboard
Cannot retrieve value of undefined directive Core.RemoveBlanks
Hi,
I am using nextcloud and its news app, which actually is an RSS reader and uses your library. Since its latest alpha build it constantly floods nextcloud logs with
{"reqId":"S9A6V7FoXrzh4bT1hs1U","level":2,"time":"2024-11-16T08:50:24+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Cannot retrieve value of undefined directive Core.RemoveBlanks invoked on line 75 in file /var/www/nextcloud/apps/news/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php at /var/www/nextcloud/apps/news/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php#901","userAgent":"--","version":"30.0.2.2","data":{"app":"PHP"},"id":"67385db8a6022"}
And the Dev suggested to post this here, as it seems to be an upstream issue in your library. Please also check this bugreport in nextcloud/news https://github.com/nextcloud/news/issues/2883
We didn't remove this directive. What if you reinstall HTML Purifier?
The directive was added in 4.18 (latest release), but I cannot replicate the issue when using DOMLex. $config->get('Core.RemoveBlanks') returns false
I'm also experiencing this in nextcloud news. Is there anything specific I can dig into to help investigate?
I don't really know much about HTML Purifyer, but I guess it is bundled with nextcloud news as an external library would I just need to replace a file to reinstall it? Or is it actually installed in the os?
OK, so this is shipping with the nextcloud-news app, nothing I could do there I guess
I am guessing they botched their bundle. Go complain back at them.
So you confirm everything is working from your side? I guess that "RemoveBlanks" function is widely used and it would surface immediately if there was a bug at your side, right?
I am guessing they botched their bundle. Go complain back at them.
News just ships whatever Composer gives us, is there a way to further debug this?
The initialisation in news is done like this: https://github.com/nextcloud/news/blob/594be805c85c8b06c9b9918f90453309cfd1ade3/lib/AppInfo/Application.php#L103
I'd go look at the ConfigSchema ser and manually check it matches what's in Git
Hello, I am not using nextcloud and have also noticed this exact issue when using the latest version of htmlpurifier v4.18.0. We have temporarily fixed it by reverting to v4.17.0.
I also have the same issue, and I'm installing it directly from Composer.
It seems the nextcloud news team have narrowed the issue down to another app using htmlpurifier as well, causing dependency issues, if I got it right. Check here: https://github.com/nextcloud/news/issues/3017
Sorry, I didn't write that very clearly; I'm installing HTMLPurifier directly from composer. I don't have nextcloud installed and have never used it. I've tried rolling back to 4.17.0 but that didn't fix it either, sadly.
What I wanted to asy, is there anything else, using htmlpurifier on your system that could cause cross dependencies?
My understanding is that this is not a HTMLPurifier issue. They had the news app running v4.17.0 and the mail app running v.4.18.0. That created a conflict as Core.RemoveBlanks was only introduced in v4.18.0