diff --git a/core/search.php b/core/search.php index fc7f343b..4a38b97c 100644 --- a/core/search.php +++ b/core/search.php @@ -2,7 +2,7 @@ $start_search = "true"; -$s = sanitizeUserInputs($s); +$s = sanitizeUserInputs($_REQUEST['s']); if($s != '' && strlen($s) < 3) { $start_search = "false"; diff --git a/core/switch.php b/core/switch.php index 1b263d9e..45d893c6 100644 --- a/core/switch.php +++ b/core/switch.php @@ -465,6 +465,9 @@ /* confirm new account */ if($p == "account") { + $user = fc_return_clean_value($_GET['user']); + $al = fc_return_clean_value($_GET['al']); + $verify = $db_content->update("fc_user", [ "user_verified" => 'verified' ], [ diff --git a/core/user_management.php b/core/user_management.php index 091876f5..51456190 100644 --- a/core/user_management.php +++ b/core/user_management.php @@ -6,7 +6,7 @@ unset($status_msg); -if($goto == 'logout') { +if($query == 'logout') { if(is_numeric($_SESSION['user_id'])) { // delete data from fc_tokens $db_user->delete("fc_tokens",[ @@ -53,7 +53,7 @@ if($_SESSION['user_nick'] != "") { $status_msg = $lang['msg_login_true']; - $link_logout = $fc_base_url.'?goto=logout'; + $link_logout = $fc_base_url.'logout'; $link_profile = FC_INC_DIR . "/profile/"; /* user == administrator */ diff --git a/core/user_updateprofile.php b/core/user_updateprofile.php index c62b4f68..0bceed5f 100644 --- a/core/user_updateprofile.php +++ b/core/user_updateprofile.php @@ -155,24 +155,25 @@ // show data in form - if(is_file("content/avatars/".md5($_SESSION['user_nick']) . ".png")){ + if(is_file("content/avatars/".md5($_SESSION['user_nick']) . ".png")) { $avatar_url = FC_INC_DIR . "/content/avatars/".md5($_SESSION['user_nick']) . ".png"; $smarty->assign("avatar_url","$avatar_url"); - $link_avatar_delete_url = $fc_base_url.'?p=profile&delete_avatar=true'; + $link_avatar_delete_url = $fc_base_url.'profile/'; $link_avatar_delete = ''.$lang['link_delete_avatar'].''; $link_avatar_delete_text = $lang['link_delete_avatar']; $smarty->assign("link_avatar_delete","$link_avatar_delete",true); $smarty->assign("link_avatar_delete_url","$link_avatar_delete_url",true); $smarty->assign("link_avatar_delete_text","$link_avatar_delete_text",true); - - if($delete_avatar == true) { - unlink("content/avatars/".md5($_SESSION['user_nick']) . ".png"); - $smarty->assign("avatar_url","",true); - $smarty->assign("link_avatar_delete","",true); - } + } + + /* delete avatar */ + if(isset($_POST['delete_avatar'])) { + unlink("content/avatars/".md5($_SESSION['user_nick']) . ".png"); + $smarty->assign("avatar_url","",true); + $smarty->assign("link_avatar_delete","",true); } diff --git a/styles/default/templates/profile_main.tpl b/styles/default/templates/profile_main.tpl index 27f97572..fdf7430c 100644 --- a/styles/default/templates/profile_main.tpl +++ b/styles/default/templates/profile_main.tpl @@ -101,9 +101,9 @@
- - {if isset($link_avatar_delete_url)} - {$link_avatar_delete_text} + + {if isset($avatar_url)} + {/if}