removed unused global db-variables

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-11-17 12:31:15 +01:00
parent 97c6385c36
commit 0b3df4c7d7
2 changed files with 24 additions and 41 deletions

View File

@@ -25,15 +25,14 @@
* @author Florian Lippert <flo@syscp.org>
* @author Ron Brand <ron.brand@web.de>
*/
function standard_error($errors = '', $replacer = '') {
global $userinfo, $s, $header, $footer, $lng, $theme;
function standard_error($errors = '', $replacer = '')
{
global $db, $userinfo, $s, $header, $footer, $lng, $theme;
$_SESSION['requestData'] = $_POST;
$replacer = htmlentities($replacer);
if(!is_array($errors))
{
if (!is_array($errors)) {
$errors = array(
$errors
);
@@ -45,25 +44,18 @@ function standard_error($errors = '', $replacer = '')
}
$error = '';
foreach($errors as $single_error)
{
if(isset($lng['error'][$single_error]))
{
foreach ($errors as $single_error) {
if (isset($lng['error'][$single_error])) {
$single_error = $lng['error'][$single_error];
$single_error = strtr($single_error, array('%s' => $replacer));
}
else
{
} else {
$error = 'Unknown Error (' . $single_error . '): ' . $replacer;
break;
}
if(empty($error))
{
if (empty($error)) {
$error = $single_error;
}
else
{
} else {
$error.= ' ' . $single_error;
}
}