[PR #4533] [MERGED] Fixes #4489: Adding last resort truncation to User Model's getShortName() function #6376

Closed
opened 2026-02-05 10:30:39 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/4533
Author: @Bajszi97
Created: 9/11/2023
Status: Merged
Merged: 9/13/2023
Merged by: @ssddanbrown

Base: developmentHead: development


📝 Commits (3)

  • f997d3e Trimmed name last resort
  • f4deb13 Truncate with three dots
  • 83028f3 Test comment creator name truncation

📊 Changes

2 files changed (+17 additions, -1 deletions)

View changed files

📝 app/Users/Models/User.php (+1 -1)
📝 tests/Entity/CommentTest.php (+16 -0)

📄 Description

This pull request closes issue #4489

by providing a last resort option to the getShortName() function within the User model. This option is necessary because the function fails to return anything in some cases. If the name is too long and cannot be split by spaces, it will be trimmed to the specified number of characters, followed by two dots ('..').


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/4533 **Author:** [@Bajszi97](https://github.com/Bajszi97) **Created:** 9/11/2023 **Status:** ✅ Merged **Merged:** 9/13/2023 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `development` --- ### 📝 Commits (3) - [`f997d3e`](https://github.com/BookStackApp/BookStack/commit/f997d3e0bbd6dd9bbd90c75a1df8903323609512) Trimmed name last resort - [`f4deb13`](https://github.com/BookStackApp/BookStack/commit/f4deb13301feb6087cb56f22ef52230905821952) Truncate with three dots - [`83028f3`](https://github.com/BookStackApp/BookStack/commit/83028f3fbea8ead701b604d161100923545fcb53) Test comment creator name truncation ### 📊 Changes **2 files changed** (+17 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `app/Users/Models/User.php` (+1 -1) 📝 `tests/Entity/CommentTest.php` (+16 -0) </details> ### 📄 Description This pull request closes issue #4489 by providing a last resort option to the getShortName() function within the User model. This option is necessary because the function fails to return anything in some cases. If the name is too long and cannot be split by spaces, it will be trimmed to the specified number of characters, followed by two dots ('..'). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:30:39 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6376