Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
0e3a7be5
Commit
0e3a7be5
authored
Sep 10, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not require http:// or https:// on user/proj urls.
parent
64b3fdea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
13 deletions
+32
-13
www/defs.php3.in
www/defs.php3.in
+1
-2
www/joinproject.php3
www/joinproject.php3
+11
-4
www/newproject.php3
www/newproject.php3
+20
-7
No files found.
www/defs.php3.in
View file @
0e3a7be5
...
...
@@ -516,8 +516,7 @@ function CHECKURL($url, &$error) {
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
;
$url
=
"${HTTPTAG}"
.
$url
;
}
$fp
=
@
fopen
(
$url
,
"r"
);
...
...
www/joinproject.php3
View file @
0e3a7be5
<?php
#
# Copyright (c) 2000-201
3
University of Utah and the Flux Group.
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -687,9 +687,16 @@ if (! $returning) {
if
(
!
$forwikionly
)
{
if
(
isset
(
$formfields
[
"usr_URL"
])
&&
strcmp
(
$formfields
[
"usr_URL"
],
""
)
&&
strcmp
(
$formfields
[
"usr_URL"
],
$HTTPTAG
)
&&
!
CHECKURL
(
$formfields
[
"usr_URL"
],
$urlerror
))
{
$errors
[
"Home Page URL"
]
=
$urlerror
;
strcmp
(
$formfields
[
"usr_URL"
],
$HTTPTAG
))
{
if
(
strcmp
(
$HTTPTAG
,
substr
(
$formfields
[
"usr_URL"
],
0
,
strlen
(
$HTTPTAG
)))
&&
strcmp
(
$HTTPSTAG
,
substr
(
$formfields
[
"usr_URL"
],
0
,
strlen
(
$HTTPSTAG
))))
{
$formfields
[
"usr_URL"
]
=
"${HTTPTAG}"
.
$formfields
[
"usr_URL"
];
}
if
(
!
CHECKURL
(
$formfields
[
"usr_URL"
],
$urlerror
))
{
$errors
[
"Home Page URL"
]
=
$urlerror
;
}
}
if
(
!
isset
(
$formfields
[
"usr_addr"
])
||
strcmp
(
$formfields
[
"usr_addr"
],
""
)
==
0
)
{
...
...
www/newproject.php3
View file @
0e3a7be5
...
...
@@ -816,9 +816,16 @@ if (! $returning) {
if
(
isset
(
$formfields
[
"usr_URL"
])
&&
strcmp
(
$formfields
[
"usr_URL"
],
""
)
&&
strcmp
(
$formfields
[
"usr_URL"
],
$HTTPTAG
)
&&
!
$FirstInitState
&&
!
CHECKURL
(
$formfields
[
"usr_URL"
],
$urlerror
))
{
$errors
[
"Home Page URL"
]
=
$urlerror
;
!
$FirstInitState
)
{
if
(
strcmp
(
$HTTPTAG
,
substr
(
$formfields
[
"usr_URL"
],
0
,
strlen
(
$HTTPTAG
)))
&&
strcmp
(
$HTTPSTAG
,
substr
(
$formfields
[
"usr_URL"
],
0
,
strlen
(
$HTTPSTAG
))))
{
$formfields
[
"usr_URL"
]
=
"${HTTPTAG}"
.
$formfields
[
"usr_URL"
];
}
if
(
!
CHECKURL
(
$formfields
[
"usr_URL"
],
$urlerror
))
{
$errors
[
"Home Page URL"
]
=
$urlerror
;
}
}
if
(
!
isset
(
$formfields
[
"usr_addr"
])
||
strcmp
(
$formfields
[
"usr_addr"
],
""
)
==
0
)
{
...
...
@@ -939,9 +946,16 @@ if (!isset($formfields["proj_URL"]) ||
strcmp
(
$formfields
[
"proj_URL"
],
$HTTPTAG
)
==
0
)
{
$errors
[
"Project URL"
]
=
"Missing Field"
;
}
elseif
(
!
$FirstInitState
&&
!
CHECKURL
(
$formfields
[
"proj_URL"
],
$urlerror
))
{
$errors
[
"Project URL"
]
=
$urlerror
;
elseif
(
!
$FirstInitState
)
{
if
(
strcmp
(
$HTTPTAG
,
substr
(
$formfields
[
"proj_URL"
],
0
,
strlen
(
$HTTPTAG
)))
&&
strcmp
(
$HTTPSTAG
,
substr
(
$formfields
[
"proj_URL"
],
0
,
strlen
(
$HTTPSTAG
))))
{
$formfields
[
"proj_URL"
]
=
"${HTTPTAG}"
.
$formfields
[
"proj_URL"
];
}
if
(
!
CHECKURL
(
$formfields
[
"proj_URL"
],
$urlerror
))
{
$errors
[
"Project URL"
]
=
$urlerror
;
}
}
if
(
!
isset
(
$formfields
[
"proj_funders"
])
||
strcmp
(
$formfields
[
"proj_funders"
],
""
)
==
0
)
{
...
...
@@ -1025,7 +1039,6 @@ if (!$returning) {
$args
[
"wikiname"
]
=
$formfields
[
"wikiname"
];
}
if
(
isset
(
$formfields
[
"usr_URL"
])
&&
$formfields
[
"usr_URL"
]
!=
$HTTPTAG
&&
$formfields
[
"usr_URL"
]
!=
""
)
{
$args
[
"URL"
]
=
$formfields
[
"usr_URL"
];
...
...
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