Skip to content

Commit ba8ca9a

Browse files
denphinkissebe
authored andcommitted
Update URL validation regex to include fragment
1 parent 641ce61 commit ba8ca9a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • core/components/com_courses/models/assets

core/components/com_courses/models/assets/url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function create()
6666

6767
foreach ($urls as $url)
6868
{
69-
if (!preg_match('/^(http[s]*\:\/\/)?([0-9A-Za-z\.\/\-\=\:\?\_\&\%\~\(\)]+)$/', $url, $matches))
69+
if (!preg_match('/^(http[s]*\:\/\/)?([0-9A-Za-z\.\/\-\=\:\?\_\&\%\~\(\)]+)((#[0-9A-Za-z_-]+)?)$/', $url, $matches))
7070
{
7171
return array('error' => 'Content did not match the pre-defined filter');
7272
}

0 commit comments

Comments
 (0)