Make validate_url more intuitive

- Remove the parameter passed by reference
- Add modified url in return value
This commit is contained in:
Hypolite Petovan 2017-12-16 19:23:22 -05:00
parent e16852c2f5
commit 1724dd3841
5 changed files with 21 additions and 20 deletions

View file

@ -198,8 +198,6 @@ class User
$password = $password1;
}
$tmp_str = $openid_url;
if ($using_invites) {
if (!$invite_id) {
throw new Exception(t('An invitation is required.'));
@ -212,7 +210,7 @@ class User
if (!x($username) || !x($email) || !x($nickname)) {
if ($openid_url) {
if (!validate_url($tmp_str)) {
if (!validate_url($openid_url)) {
throw new Exception(t('Invalid OpenID url'));
}
$_SESSION['register'] = 1;
@ -235,7 +233,7 @@ class User
throw new Exception(t('Please enter the required information.'));
}
if (!validate_url($tmp_str)) {
if (!validate_url($openid_url)) {
$openid_url = '';
}