diff --git a/core/components/com_courses/models/asset.php b/core/components/com_courses/models/asset.php index d438abd859..5b4032f0fb 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; }