~netlandish/links-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH links] Fix import error when bookmark title is more than 150 characters

Details
Message ID
<20250221233432.30703-1-peter@netlandish.com>
Sender timestamp
1740159197
DKIM signature
missing
Download raw message
Patch: +5 -1
---
One of the few places where we don't use the API for writing and it was
missing a max length check. This is the biggest issue when not using the
single point for storing data, you end up missing checks that already 
exist else where.

 core/import.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/core/import.go b/core/import.go
index c908823..7e6aebb 100644
--- a/core/import.go
+++ b/core/import.go
@@ -283,8 +283,12 @@ func processOrgLinks(obj importObj, baseURLMap map[string]int,
		}
	}

	title := obj.GetTitle()
	if len(title) > 150 {
		title = title[:146] + "..."
	}
	return &models.OrgLink{
		Title:       obj.GetTitle(),
		Title:       title,
		URL:         obj.GetURL(),
		Description: obj.GetDescription(),
		BaseURLID:   sql.NullInt64{Valid: true, Int64: int64(baseID)},
-- 
2.47.2
Details
Message ID
<D7YIOCSWSSDN.1OPWV2243R5TT@netlandish.com>
In-Reply-To
<20250221233432.30703-1-peter@netlandish.com> (view parent)
Sender timestamp
1740159386
DKIM signature
missing
Download raw message
Applied.

To git@git.code.netlandish.com:~netlandish/links
   44ef6e8..513b408  master -> master
Reply to thread Export thread (mbox)