Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
RFC 1035 states that the maximum length of a DNS label is 63 characters. The Subdomain module schema has a textfield for the subdomain value with a maximum length of 255. Creating subdomains exceeding the length of 63 can result in URI’s with FQDN's that do not resolve.
Proposed resolution
Update the module schema and form definition, limiting subdomains to 63 characters, and add a new hook_update_N() to retroactively trim subdomains exceeding 63 characters, and change the field definition afterwards.
Comment | File | Size | Author |
---|---|---|---|
#1 | subdomain-fix-maximum-length-2402523-1.patch | 2.39 KB | dstotijn |
Comments
Comment #1
dstotijn CreditAttribution: dstotijn commentedComment #3
ohthehugemanatee CreditAttribution: ohthehugemanatee at Forum One commentedSimple enough, and correct. Committed.