#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)
This ticket was mentioned in Slack in #meta by otto42. View the logs.
7 years ago
#2
@
7 years ago
- Component changed from General to I18N
- Keywords needs-patch added
- Version set to 4.9.1
#7
@
5 years ago
- Keywords close removed
- Milestone WordPress.org deleted
- Resolution set to wontfix
- Status changed from new to closed
The i18n tools have been removed in favour of the WP-CLI integration.
Version 0, edited 5 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.