[wp-trac] [WordPress Trac] #62568: MAX_LENGTH = 64 in /wp-includes/Requests/src/IdnaEncoder.php is too restrictive for modern URL use cases.

WordPress Trac noreply at wordpress.org
Tue Nov 26 06:54:48 UTC 2024


#62568: MAX_LENGTH = 64 in /wp-includes/Requests/src/IdnaEncoder.php is too
restrictive for modern URL use cases.
-------------------------+------------------------------
 Reporter:  knufflpuffl  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Charset      |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by abcd95):

 Hey @knufflpuffl, Welcome to Trac, and thanks for bringing this up.

 == Reproduction Report
 === Description
 I've confirmed the issue with the 64-character limitation in IdnaEncoder.
 I was able to reproduce the error.

 === Environment
 - WordPress: 6.7.1
 - PHP: 8.1.29
 - Server: nginx/1.16.0
 - Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
 - Browser: Chrome 131.0.0.0
 - OS: macOS


 === Steps

 Ran the following code -
 {{{
 $test_url = 'a-very-long-subdomain-name-that-exceeds-sixty-four-
 characters-hii';
 $encoder  = new \WpOrg\Requests\IdnaEncoder();
 $encoded  = $encoder->encode( $test_url );
 }}}

 Error Received:
 {{{
 PHP Fatal error: Uncaught WpOrg\Requests\Exception: Provided string is too
 long in .../wp-includes/Requests/src/IdnaEncoder.php:93
 }}}

 === Actual Results
 ✅ This issue was reproduced

 === Additional Notes
 This seems to work fine with shorter URLs but the issue arises when the
 limit of 64 characters is breached.

 Also, when manually increasing the limit from 64 to 255 in -
 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/Requests/src/IdnaEncoder.php#L37

 The 65-character-long URL worked fine.

 === Supplemental Artifacts
 Screenshot of the error logs - https://postimg.cc/QBmF3NHL

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62568#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list