Problem/Motivation

When visiting a page whose URL contains non-ASCII characters (e.g. Korean, Japanese, Chinese),
the database insert fails with the error:

Data too long for column 'ref_char' at row 1

This also triggers a PHP memory_limit error as a downstream symptom
of processing the oversized string.

Allowed memory size of 1073741824 bytes exhausted (tried to allocate 853544960 bytes) in /var/www/html/docroot/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php on line 77

The audit trail logger reads the redirect source URL via getSourceUrl(),
which returns the URL in RFC 3986 percent-encoded form. Each Korean character is
encoded as three %XX sequences, expanding the string to roughly 4× its
original length. For example:

  • %EC%8B%9C (1 character → 9 characters)

This causes the value to far exceed the size of the ref_char column.

Steps to reproduce

  1. Create a redirect whose source path contains non-ASCII characters, e.g.
    /ko-kr/안녕하세요, 드루팔에 오신 것을 환영합니다. 간단하고 빠르게 만들어 드립니다.
  2. Visit that path.

Proposed resolution

Decode the value before storing it:

rawurldecode($redirect->getSourceUrl())

either for the description and for the ref_char column

This stores the human-readable path, is more useful for audit log reviewers, and
eliminates the column overflow.

Remaining tasks

  • ✅ File an issue
  • ➖ Fix: decode ref_char value before insert, or null it when too long
  • ➖ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ➖ Code review by maintainers
  • ➖ Full testing and approval
  • ➖ Credit contributors
  • ➖ Review with the product owner
  • ➖ Release notes snippet
  • ❌ Release

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A

Comments

alexortega_98 created an issue. See original summary.

alexortega_98’s picture