Skip to content

Commit

Permalink
Merge pull request #5442 from BOINC/dpa_web9
Browse files Browse the repository at this point in the history
web: fix PHP warning in login action.
  • Loading branch information
AenBleidd authored Dec 5, 2023
2 parents 1a7d5f4 + adca07d commit de19de5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 9 additions & 4 deletions html/user/login_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ function login_with_ldap($uid, $passwd, $next_url, $perm) {
}

$next_url = post_str("next_url", true);
$next_url = urldecode($next_url);
$next_url = sanitize_local_url($next_url);
if (strlen($next_url) == 0) {
if ($next_url) {
$next_url = urldecode($next_url);
$next_url = sanitize_local_url($next_url);
}
if (!$next_url) {
$next_url = USER_HOME;
}

Expand All @@ -183,7 +185,10 @@ function login_with_ldap($uid, $passwd, $next_url, $perm) {
exit;
}

$email_addr = strtolower(sanitize_tags(post_str("email_addr", true)));
$email_addr = post_str("email_addr", true);
if ($email_addr) {
$email_addr = strtolower(sanitize_tags($email_addr));
}
$passwd = post_str("passwd", true);
if ($email_addr && $passwd) {
if (LDAP_HOST && !is_valid_email_addr($email_addr)) {
Expand Down
3 changes: 3 additions & 0 deletions sched/file_upload_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ int handle_file_upload(FILE* in, R_RSA_PUBLIC_KEY& key) {
strcpy(name, "");
strcpy(xml_signature, "");
bool found_data = false;

// TODO: use XML parser

while (boinc::fgets(buf, 256, in)) {
log_messages.printf(MSG_DETAIL, "got:%s\n", buf);
if (match_tag(buf, "<file_info>")) continue;
Expand Down

0 comments on commit de19de5

Please sign in to comment.