Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
f0cfb02e
Commit
f0cfb02e
authored
Mar 31, 2014
by
Leigh B Stoller
Browse files
Allow https:// in checkurl().
parent
521b3912
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/defs.php3.in
View file @
f0cfb02e
...
...
@@ -145,6 +145,7 @@ $TBEMAILCOOKIE = "MyEmailCookie" . $TBCOOKIESUFFIX;
$TBLOGINCOOKIE
=
"NewLoginCookie"
.
$TBCOOKIESUFFIX
;
$HTTPTAG
=
"http://"
;
$HTTPSTAG
=
"https://"
;
$TBMAIL_OPS
=
"Testbed Ops <
$TBMAILADDR_OPS
>"
;
$TBMAIL_WWW
=
"Testbed WWW <
$TBMAILADDR_WWW
>"
;
...
...
@@ -474,7 +475,7 @@ function ADDPUBKEY($cmdandargs) {
# Verify a URL.
#
function
CHECKURL
(
$url
,
&
$error
)
{
global
$HTTPTAG
;
global
$HTTPTAG
,
$HTTPSTAG
;
if
(
strlen
(
$url
))
{
if
(
strstr
(
$url
,
" "
))
{
...
...
@@ -482,8 +483,9 @@ function CHECKURL($url, &$error) {
return
0
;
}
if
(
strcmp
(
$HTTPTAG
,
substr
(
$url
,
0
,
strlen
(
$HTTPTAG
))))
{
$error
=
"URL is malformed; must begin with
$HTTPTAG
!"
;
if
(
strcmp
(
$HTTPTAG
,
substr
(
$url
,
0
,
strlen
(
$HTTPTAG
)))
&&
strcmp
(
$HTTPSTAG
,
substr
(
$url
,
0
,
strlen
(
$HTTPSTAG
))))
{
$error
=
"URL is malformed; must begin with
$HTTPTAG
or
$HTTPSTAG
!"
;
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment