mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Minor adjustments #572
* Replaced bb_ltrim method with native * Replaced bb_rtrim method with native * Simplified make_rand_str method
This commit is contained in:
parent
21e1ebc86d
commit
90d1fc4236
3 changed files with 15 additions and 31 deletions
|
@ -926,34 +926,12 @@ function get_db_stat($mode)
|
|||
function clean_username($username)
|
||||
{
|
||||
$username = mb_substr(htmlspecialchars(str_replace("\'", "'", trim($username))), 0, 25, 'UTF-8');
|
||||
$username = bb_rtrim($username, "\\");
|
||||
$username = rtrim($username, "\\");
|
||||
$username = str_replace("'", "\'", $username);
|
||||
|
||||
return $username;
|
||||
}
|
||||
|
||||
function bb_ltrim($str, $charlist = false)
|
||||
{
|
||||
if ($charlist === false) {
|
||||
return ltrim($str);
|
||||
}
|
||||
|
||||
$str = ltrim($str, $charlist);
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
function bb_rtrim($str, $charlist = false)
|
||||
{
|
||||
if ($charlist === false) {
|
||||
return rtrim($str);
|
||||
}
|
||||
|
||||
$str = rtrim($str, $charlist);
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
// Get Userdata, $u can be username or user_id. If $force_name is true, the username will be forced.
|
||||
function get_userdata($u, $force_name = false, $allow_guest = false)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue