#42818 closed defect (bug) (wontfix)
i18n Tools have PHP 7.2 compatibility issues
| Reported by: | Otto42 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | I18N | Version: | 4.9.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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)
This ticket was mentioned in Slack in #meta by otto42. View the logs.
9 years ago
#3
@
9 years ago
Version 0, edited 9 years ago by
(next)
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.