Change #256573
| Category | ggettext |
| Changed by | Bruno Haible <bruno@clisp.org> |
| Changed at | Wed 28 Jan 2026 13:50:21 |
| Repository | git://git.savannah.gnu.org/gettext.git |
| Project | ggettext |
| Branch | master |
| Revision | 053b5ef04dcdd077d66ed91470432be8c9c8a49e |
Comments
xgettext: PHP: Fix parsing of strings and heredocs with embedded expressions. Reported by Gert Jan Schoneveld <gertjan@facilityapps.com> in <https://lists.gnu.org/archive/html/bug-gettext/2025-08/msg00007.html> and by Benoit Waldmann <benoit.waldmann@siagilus.fr> at <https://savannah.gnu.org/bugs/index.php?item_id=67948>. * gettext-tools/src/x-php.c (enum token_type_ty): New enum values token_type_lbrace, token_type_rbrace. (struct php_extractor): New field brace_nesting_depth. (php_extractor_init_rest): Initialize it. (extract_balanced): Forward-declare. (process_dquote_or_heredoc): Change handling of embedded expressions. (phase4_get): Recognize token_type_lbrace, token_type_rbrace. (extract_balanced): Recurse also for token_type_lbrace. (extract_php_input): Remove function. (extract_php): Inline it here. * gettext-tools/tests/xgettext-php-1: Add more tests of embedded expressions.
Changed files
- gettext-tools/src/x-php.c
- gettext-tools/tests/xgettext-php-1