From 7f2406d6d20e7dc1a4054921c97d653d83ba9479 Mon Sep 17 00:00:00 2001 From: Daniel Mejia Date: Thu, 15 Jan 2026 17:10:49 -0500 Subject: [PATCH] Restore truncated url Restore truncated url --- core/components/com_courses/models/asset.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/components/com_courses/models/asset.php b/core/components/com_courses/models/asset.php index d438abd8598..5b4032f0fb1 100644 --- a/core/components/com_courses/models/asset.php +++ b/core/components/com_courses/models/asset.php @@ -162,9 +162,18 @@ public function path($course=0, $withUrl=true) // Override path for url/link type assets if (in_array(strtolower($this->get('type')), array('form', 'link', 'url'))) { - $path = $this->get('url'); + $path = $this->get('url'); // may be truncated (VARCHAR 255) + $content = $this->get('content'); // contains full URL + // Heuristic: truncated URLs usually hit the column limit + if ($path !== null && strlen($path) >= 250) + { + // Try to recover the full URL from content + if (preg_match('~https?://[^\s"\')<>]+~i', $content, $m)) + { + $path = $m[0]; + } + } } - return $path; }