Address 'returning a value from a constructor is deprecated' warnings
This commit is contained in:
1 parent
4e771ac23d
commit
858a75dc66
3 files changed
+36
-11
No files matched your search
@@ -89,7 +89,8 @@ class EditAsset extends HTMLController
|
|||||||
if (isset($_GET['updatethumb']))
|
if (isset($_GET['updatethumb']))
|
||||||
{
|
{
|
||||||
$image = $asset->getImage();
|
$image = $asset->getImage();
|
||||||
return $this->updateThumb($image);
|
$this->updateThumb($image);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key info
|
// Key info
|
||||||
|
|||||||
@@ -129,7 +129,10 @@ class EditUser extends HTMLController
|
|||||||
|
|
||||||
// Anything missing?
|
// Anything missing?
|
||||||
if (!empty($form->getMissing()))
|
if (!empty($form->getMissing()))
|
||||||
return $formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'danger'));
|
{
|
||||||
|
$formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'danger'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
|
|
||||||
@@ -150,18 +153,30 @@ class EditUser extends HTMLController
|
|||||||
|
|
||||||
// If it looks like an e-mail address...
|
// If it looks like an e-mail address...
|
||||||
if (!empty($data['emailaddress']) && !preg_match('~^[^ ]+@[^ ]+\.[a-z]+$~', $data['emailaddress']))
|
if (!empty($data['emailaddress']) && !preg_match('~^[^ ]+@[^ ]+\.[a-z]+$~', $data['emailaddress']))
|
||||||
return $formview->adopt(new Alert('Email addresses invalid', 'The email address you entered is not a valid email address.', 'danger'));
|
{
|
||||||
|
$formview->adopt(new Alert('Email addresses invalid', 'The email address you entered is not a valid email address.', 'danger'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Check whether email address is already linked to an account in the database -- just not to the account we happen to be editing, of course.
|
// Check whether email address is already linked to an account in the database -- just not to the account we happen to be editing, of course.
|
||||||
elseif (!empty($data['emailaddress']) && Member::exists($data['emailaddress']) && !($id_user && $user->getEmailAddress() == $data['emailaddress']))
|
elseif (!empty($data['emailaddress']) && Member::exists($data['emailaddress']) && !($id_user && $user->getEmailAddress() == $data['emailaddress']))
|
||||||
return $formview->adopt(new Alert('Email address already in use', 'Another account is already using the e-mail address you entered.', 'danger'));
|
{
|
||||||
|
$formview->adopt(new Alert('Email address already in use', 'Another account is already using the e-mail address you entered.', 'danger'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Setting passwords? We'll need two!
|
// Setting passwords? We'll need two!
|
||||||
if (!$id_user || !empty($data['password1']) && !empty($data['password2']))
|
if (!$id_user || !empty($data['password1']) && !empty($data['password2']))
|
||||||
{
|
{
|
||||||
if (strlen($data['password1']) < 6 || !preg_match('~[^A-z]~', $data['password1']))
|
if (strlen($data['password1']) < 6 || !preg_match('~[^A-z]~', $data['password1']))
|
||||||
return $formview->adopt(new Alert('Password not acceptable', 'Please fill in a password that is at least six characters long and contains at least one non-alphabetic character (e.g. a number or symbol).', 'danger'));
|
{
|
||||||
|
$formview->adopt(new Alert('Password not acceptable', 'Please fill in a password that is at least six characters long and contains at least one non-alphabetic character (e.g. a number or symbol).', 'danger'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
elseif ($data['password1'] !== $data['password2'])
|
elseif ($data['password1'] !== $data['password2'])
|
||||||
return $formview->adopt(new Alert('Passwords do not match', 'The passwords you entered do not match. Please try again.', 'danger'));
|
{
|
||||||
|
$formview->adopt(new Alert('Passwords do not match', 'The passwords you entered do not match. Please try again.', 'danger'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$data['password'] = $data['password1'];
|
$data['password'] = $data['password1'];
|
||||||
|
|
||||||
@@ -171,9 +186,12 @@ class EditUser extends HTMLController
|
|||||||
// Creating a new user?
|
// Creating a new user?
|
||||||
if (!$id_user)
|
if (!$id_user)
|
||||||
{
|
{
|
||||||
$return = Member::createNew($data);
|
$newUser = Member::createNew($data);
|
||||||
if ($return === false)
|
if ($newUser === false)
|
||||||
return $formview->adopt(new Alert('Cannot create this user', 'Something went wrong while creating the user...', 'danger'));
|
{
|
||||||
|
$formview->adopt(new Alert('Cannot create this user', 'Something went wrong while creating the user...', 'danger'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_POST['submit_and_new']))
|
if (isset($_POST['submit_and_new']))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,10 +18,16 @@ class ProvideAutoSuggest extends JSONController
|
|||||||
throw new UnexpectedValueException('Unsupported autosuggest request.');
|
throw new UnexpectedValueException('Unsupported autosuggest request.');
|
||||||
|
|
||||||
if ($_REQUEST['type'] === 'tags' && isset($_REQUEST['data']))
|
if ($_REQUEST['type'] === 'tags' && isset($_REQUEST['data']))
|
||||||
return $this->handleTagSearch();
|
{
|
||||||
|
$this->handleTagSearch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($_REQUEST['type'] === 'createtag' && isset($_REQUEST['tag']))
|
if ($_REQUEST['type'] === 'createtag' && isset($_REQUEST['tag']))
|
||||||
return $this->handleTagCreation();
|
{
|
||||||
|
$this->handleTagCreation();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function handleTagSearch()
|
private function handleTagSearch()
|
||||||
|
|||||||
Reference in new issue
Block a user