Closed roelofr closed 4 years ago
👍
The Issue #246 could easily be fixed by renaming the class from HTMLPurifier_Language_en_x_test
to en_x_test
. It is not compatible with the filename. Thats all 😁😨
It's not compatible with the LanguageFactory when you change it like that though, which will cause issues for those not using en
as language.
Although a rewrite is good, since its non-standard, the deprecation warning was fixed in 4faca32a4d4b8152d17956606e1fb5043fcc1f10.
Yeah, this isn't worth it. Would be better to just remove localization support. I'd accept a PR that did that.
Although the class won't break anything when Composer 2.0 seizes to load the
en-x-test
file, it's causing deprecations all over the board. This would be easily solvable by letting the Composer autoloader take care of it, but with the wide range of autoloaders used, and the custom autoloader in the tests, this won't do.This solves it by checking the
HTMLPurifier/Languages
directory for our class, afterHTMLPurifier/Languages/clases/
doesn't contain it and the class isn't already loaded. It adds some extra logic, but in the 99% use-case this won't see any real impact.The old structure has preference, for backwards compatibility.
Closes #246.