Skip to content

Document the missing ValueErrors for the gettext functions - #6044

Open
abp002 wants to merge 1 commit into
php:masterfrom
abp002:gettext-errors
Open

abp002 wants to merge 1 commit into
php:masterfrom
abp002:gettext-errors

Conversation

@abp002

@abp002 abp002 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Adds the missing Errors sections and changelog rows on the gettext pages listed in #6001.

  • dcgettext() and dcngettext() throw if domain is empty or longer than 1024 bytes, if a message is longer than 4096 bytes, or if category is LC_ALL. Added an 8.4.0 row for the empty domain and LC_ALL, and an 8.0.0 row for the lengths.
  • gettext() and ngettext() throw if a message is longer than 4096 bytes (8.0.0).
  • textdomain() also throws for a domain longer than 1024 bytes (8.0.0) and for "0" (8.4.0). Before 8.4, "" and "0" just returned the current domain.
  • bindtextdomain() throws if domain is empty or longer than 1024 bytes (8.0.0, it used to warn and return false). Also noted that "0" means the current directory like "", and that a directory that doesn't exist returns false.
  • bind_textdomain_codeset() also throws for a domain longer than 1024 bytes (8.0.0), and the return value now says it returns false when no encoding is set.

Checked against ext/gettext/gettext.c on 7.4, 8.0, 8.3, 8.4 and 8.5, and ran each case on those versions.

Fixes #6001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gettext: missing ValueErrors on seven function pages

1 participant