Browse code

user/editprefs.php: Finally fix ~20-year-old skin selecting bug! Here was the bug in question: If your future selected skin was going to be the same as the default site's selected skin, it would not change at all unless you selected it at the site's drop-down menu, then it now became your account's selected skin.

Clarissa Walker authored on 2026/10/28 09:45:51
Showing 1 changed files
... ...
@@ -34,7 +34,7 @@ if(!defined("_CHARSET")) exit( );
34 34
 		$storyindex = isset($_POST['storyindex']) && $_POST['storyindex'] == "on" ? 1 : 0;
35 35
 		$sortby = isset($_POST['sortby']) && $_POST['sortby'] == 1 ? 1 : 0;
36 36
 		$skinnew = descript(strip_tags($_POST['skinnew']));
37
-		if($skinnew != $skin) $_SESSION[$sitekey."_skin"] = $skinnew;
37
+		if(($skinnew) != $skin || ($skinnew) == $defaultskin) $_SESSION[$sitekey."_skin"] = $skinnew;
38 38
 		dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET alertson = '$useralertson', newreviews = '$newreviews', newrespond = '$newrespond', ageconsent = '$ageconsent', tinyMCE ='$tinyMCE', userskin = '$skinnew', storyindex = '$storyindex', sortby = '$sortby' WHERE uid = '".USERUID."'");
39 39
 		$output .= write_message(_ACTIONSUCCESSFUL." "._BACK2ACCT);
40 40
 	}