Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
d612aeec
Unverified
Commit
d612aeec
authored
5 years ago
by
Julius Härtl
Browse files
Options
Downloads
Patches
Plain Diff
Fix regex to not take email uids as federated ids
Signed-off-by:
Julius Härtl
<
jus@bitgrid.net
>
parent
6ea1aef0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_sharing/src/share.js
+20
-21
20 additions, 21 deletions
apps/files_sharing/src/share.js
with
20 additions
and
21 deletions
apps/files_sharing/src/share.js
+
20
−
21
View file @
d612aeec
...
...
@@ -25,13 +25,14 @@
* @namespace
*/
OCA
.
Sharing
.
Util
=
{
/**
* Regular expression for splitting parts of remote share owners:
* "user@example.com/path/to/owncloud"
* "user@anotherexample.com@example.com/path/to/owncloud
*/
_REMOTE_OWNER_REGEXP
:
new
RegExp
(
'
^([^@]*)@(([^@]*)@)?([^/]*)([/](.*)?)?$
'
),
/**
* Regular expression for splitting parts of remote share owners:
* "user@example.com/"
* "user@example.com/path/to/owncloud"
* "user@anotherexample.com@example.com/path/to/owncloud
*/
_REMOTE_OWNER_REGEXP
:
new
RegExp
(
'
^(([^@]*)@(([^@^/^
\\
s]*)@)?)([^[
\\
s/]*)([/](.*))?$
'
),
/**
* Initialize the sharing plugin.
...
...
@@ -350,26 +351,24 @@
*/
_formatRemoteShare
:
function
(
shareWith
,
shareWithDisplayName
,
message
)
{
var
parts
=
OCA
.
Sharing
.
Util
.
_REMOTE_OWNER_REGEXP
.
exec
(
shareWith
)
if
(
!
parts
)
{
if
(
!
parts
||
!
parts
[
6
]
)
{
// display avatar of the user
var
avatar
=
'
<span class="avatar" data-username="
'
+
escapeHTML
(
shareWith
)
+
'
" title="
'
+
message
+
'
'
+
escapeHTML
(
shareWithDisplayName
)
+
'
"></span>
'
var
hidden
=
'
<span class="hidden-visually">
'
+
message
+
'
'
+
escapeHTML
(
shareWithDisplayName
)
+
'
</span>
'
return
avatar
+
hidden
}
var
userName
=
parts
[
1
]
var
userDomain
=
parts
[
3
]
var
server
=
parts
[
4
]
var
tooltip
=
message
+
'
'
+
userName
if
(
userDomain
)
{
tooltip
+=
'
@
'
+
userDomain
}
if
(
server
)
{
if
(
!
userDomain
)
{
userDomain
=
'
…
'
}
tooltip
+=
'
@
'
+
server
}
var
userName
=
parts
[
2
]
var
userDomain
=
parts
[
4
]
var
server
=
parts
[
5
]
var
tooltip
=
message
+
'
'
+
userName
if
(
userDomain
)
{
tooltip
+=
'
@
'
+
userDomain
}
if
(
server
)
{
tooltip
+=
'
@
'
+
server
}
var
html
=
'
<span class="remoteAddress" title="
'
+
escapeHTML
(
tooltip
)
+
'
">
'
html
+=
'
<span class="username">
'
+
escapeHTML
(
userName
)
+
'
</span>
'
...
...
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