]> jfr.im git - irc/UndernetIRC/cservice-web.git/commitdiff
fix: trim $theuser only if a search was done
authorStefan Wold <redacted>
Sun, 5 Feb 2023 16:23:20 +0000 (17:23 +0100)
committerStefan Wold <redacted>
Sun, 5 Feb 2023 16:23:20 +0000 (17:23 +0100)
docs/gnuworld/users.php

index 3204592710f36fef148a354665da907cc4a54207..82e57da383290d74273a1906973301bbc8f4c2a2 100755 (executable)
@@ -2,7 +2,6 @@
 require("../../php_includes/cmaster.inc");
 std_init();
 $cTheme = get_theme_info();
-$theuser = trim($theuser);
 
 $min_lvl = 800;
 $edit_lvl = 600;
@@ -37,7 +36,8 @@ if ($canedit == 0) {
 //echo "THEUSER = $theuser, THEHOSTMASK = $thehostmask, MODE = $mode, ADMIN = $admin.<br><br>\n";
 
 std_sanitise_username($user);
-if ($theuser != "" && $mode == 1 && ($admin > 0 || acl(XAT_CAN_EDIT) || acl(XAT_CAN_VIEW))) {
+if (!empty($theuser) && $mode == 1 && ($admin > 0 || acl(XAT_CAN_EDIT) || acl(XAT_CAN_VIEW))) {
+    $theuser = trim($theuser);
     $lowuser = strtolower($theuser);
     $raw_q = "FROM users WHERE lower(user_name) LIKE '" . str_replace("*", "%", $lowuser) . "'";
 //             echo "$raw_q<br><br>";