#42818 closed defect (bug) (wontfix)
i18n Tools have PHP 7.2 compatibility issues
Reported by: | Otto42 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.1 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
From #40109 and related tickets, the use of create_function is being removed everywhere, so this should extend to the tools/i18n directory as well.
The makepot.php file still contains one use of create_function, while the not-gettexted.php file uses it twice.
These should be removed and replaced with alternatives.
Attachments (3)
Change History (10)
Note: See
TracTickets for help on using
tickets.
Attached two patches that address the issue.
The first patch takes care of makepot.php, the create_function call there simply wraps the input into curly braces, so the fix is simple - move to a function of its own.
The second patch handles the two calls inside not-gettexted.php. Their usage was is a bit tricker, relying on dynamic state, so the functionality was moved into stateful classes, and a method is returned instead of a function.
The second patch also fixes two test issues in not-gettexted:
All tests pass with both patches applied.