Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
2df7460b
Commit
2df7460b
authored
Oct 23, 2014
by
Tom Evans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-807: S2S server name format
Per PR review feedback.
parent
5e9af5f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
StringUtils.java
src/java/org/jivesoftware/util/StringUtils.java
+2
-3
No files found.
src/java/org/jivesoftware/util/StringUtils.java
View file @
2df7460b
...
@@ -54,7 +54,7 @@ public class StringUtils {
...
@@ -54,7 +54,7 @@ public class StringUtils {
private
static
final
char
[]
LT_ENCODE
=
"<"
.
toCharArray
();
private
static
final
char
[]
LT_ENCODE
=
"<"
.
toCharArray
();
private
static
final
char
[]
GT_ENCODE
=
">"
.
toCharArray
();
private
static
final
char
[]
GT_ENCODE
=
">"
.
toCharArray
();
private
static
final
String
DOMAIN_NAME
=
"^(?:[A-Za-z0-9][A-Za-z0-9\\-]{0,61}[A-Za-z0-9]|[A-Za-z0-9])$"
;
private
static
final
Pattern
DOMAIN_NAME
=
Pattern
.
compile
(
"^(?:[A-Za-z0-9][A-Za-z0-9\\-]{0,61}[A-Za-z0-9]|[A-Za-z0-9])$"
)
;
private
StringUtils
()
{
private
StringUtils
()
{
// Not instantiable.
// Not instantiable.
...
@@ -1131,10 +1131,9 @@ public class StringUtils {
...
@@ -1131,10 +1131,9 @@ public class StringUtils {
if
(
domain
==
null
)
{
if
(
domain
==
null
)
{
return
false
;
return
false
;
}
}
Pattern
re
=
Pattern
.
compile
(
DOMAIN_NAME
);
StringTokenizer
parser
=
new
StringTokenizer
(
domain
,
"."
);
StringTokenizer
parser
=
new
StringTokenizer
(
domain
,
"."
);
while
(
parser
.
hasMoreTokens
())
{
while
(
parser
.
hasMoreTokens
())
{
if
(!
re
.
matcher
(
parser
.
nextToken
()).
matches
())
{
if
(!
DOMAIN_NAME
.
matcher
(
parser
.
nextToken
()).
matches
())
{
return
false
;
return
false
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment