Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
da1a8593
Commit
da1a8593
authored
Jan 14, 2011
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#1015012
by sun: Fix URL filter so that it recognizes valid URLs with # in them, e.g. twitter.
parent
ab5809ac
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/filter/filter.module
+1
-1
1 addition, 1 deletion
modules/filter/filter.module
modules/filter/filter.test
+3
-1
3 additions, 1 deletion
modules/filter/filter.test
with
4 additions
and
2 deletions
modules/filter/filter.module
+
1
−
1
View file @
da1a8593
...
...
@@ -1392,7 +1392,7 @@ function _filter_url($text, $filter) {
$domain
=
'(?:[A-Za-z0-9._+-]+\.)?[A-Za-z]{2,64}\b'
;
$ip
=
'(?:[0-9]{1,3}\.){3}[0-9]{1,3}'
;
$auth
=
'[a-zA-Z0-9:%_+*~#?&=.,/;-]+@'
;
$trail
=
'[a-zA-Z0-9:%_+*~#&\[\]=/;?\.,-]*[a-zA-Z0-9:%_+*~#&\[\]=/;-]'
;
$trail
=
'[a-zA-Z0-9:%_+*~#&\[\]=/;?
!
\.,-]*[a-zA-Z0-9:%_+*~#&\[\]=/;-]'
;
// Prepare pattern for optional trailing punctuation.
// Even these characters could have a valid meaning for the URL, such usage is
...
...
This diff is collapsed.
Click to expand it.
modules/filter/filter.test
+
3
−
1
View file @
da1a8593
...
...
@@ -1176,10 +1176,11 @@ person@example.com or mailto:person2@example.com
'<a href="mailto:person@example.com">person@example.com</a>'
=>
TRUE
,
'<a href="mailto:person2@example.com">mailto:person2@example.com</a>'
=>
TRUE
,
),
// URI parts.
// URI parts
and special characters
.
'
http://trailingslash.com/ or www.trailingslash.com/
http://host.com/some/path?query=foo&bar[baz]=beer#fragment or www.host.com/some/path?query=foo&bar[baz]=beer#fragment
http://twitter.com/#!/example/status/22376963142324226
ftp://user:pass@ftp.example.com/~home/dir1
sftp://user@nonstandardport:222/dir
ssh://192.168.0.100/srv/git/drupal.git
...
...
@@ -1188,6 +1189,7 @@ ssh://192.168.0.100/srv/git/drupal.git
'<a href="http://www.trailingslash.com/">www.trailingslash.com/</a>'
=>
TRUE
,
'<a href="http://host.com/some/path?query=foo&bar[baz]=beer#fragment">http://host.com/some/path?query=foo&bar[baz]=beer#fragment</a>'
=>
TRUE
,
'<a href="http://www.host.com/some/path?query=foo&bar[baz]=beer#fragment">www.host.com/some/path?query=foo&bar[baz]=beer#fragment</a>'
=>
TRUE
,
'<a href="http://twitter.com/#!/example/status/22376963142324226">http://twitter.com/#!/example/status/22376963142324226</a>'
=>
TRUE
,
'<a href="ftp://user:pass@ftp.example.com/~home/dir1">ftp://user:pass@ftp.example.com/~home/dir1</a>'
=>
TRUE
,
'<a href="sftp://user@nonstandardport:222/dir">sftp://user@nonstandardport:222/dir</a>'
=>
TRUE
,
'<a href="ssh://192.168.0.100/srv/git/drupal.git">ssh://192.168.0.100/srv/git/drupal.git</a>'
=>
TRUE
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment