summaryrefslogtreecommitdiffstats
path: root/web/lib/aur.inc
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib/aur.inc')
-rw-r--r--web/lib/aur.inc23
1 files changed, 6 insertions, 17 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index 81ffde26..a126bb94 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -311,12 +311,11 @@ function set_lang() {
$LANG = $row[0];
}
$update_cookie = 1;
- } else {
- $LANG = "en";
}
+ # Set $LANG to default if nothing is valid.
if (!array_key_exists($LANG, $SUPPORTED_LANGS)) {
- $LANG = "en"; # default to English
+ $LANG = DEFAULT_LANG;
}
if ($update_cookie) {
@@ -336,7 +335,7 @@ function html_header($title="") {
global $SUPPORTED_LANGS;
$login = try_login();
- $login_error = $login['error'];
+ $login_error = $login['error'];
$title = htmlspecialchars($title, ENT_QUOTES);
@@ -375,19 +374,10 @@ function can_submit_pkg($name="", $sid="") {
# recursive delete directory
#
function rm_rf($dirname="") {
- $d = dir($dirname);
- while ($f = $d->read()) {
- if ($f != "." && $f != "..") {
- if (is_dir($dirname."/".$f)) {
- rm_rf($dirname."/".$f);
- }
- if (is_file($dirname."/".$f) || is_link($dirname."/".$f)) {
- unlink($dirname."/".$f);
- }
- }
+ if ($dirname != "") {
+ exec('rm -rf ' . escapeshellcmd($dirname));
}
- $d->close();
- rmdir($dirname);
+
return;
}
@@ -410,4 +400,3 @@ function uid_from_username($username="")
return $row[0];
}
-?>