mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Simplify/optimize get_name()
This commit is contained in:
parent
2335143b34
commit
d0417bf115
@ -293,10 +293,8 @@ class Page {
|
|||||||
* @return null|string
|
* @return null|string
|
||||||
*/
|
*/
|
||||||
function get_name($uuid) {
|
function get_name($uuid) {
|
||||||
if ($uuid === null || $uuid === "" || strrpos($uuid, "#", -strlen($uuid)) !== false) return null;
|
if ($uuid === null || $uuid === "" || $uuid[0] === '#') return null;
|
||||||
if (in_array($uuid, $this->settings->console_aliases)) {
|
if (in_array($uuid, $this->settings->console_aliases)) return $this->settings->console_name;
|
||||||
return $this->settings->console_name;
|
|
||||||
}
|
|
||||||
if (array_key_exists($uuid, $this->uuid_name_cache)) return $this->uuid_name_cache[$uuid];
|
if (array_key_exists($uuid, $this->uuid_name_cache)) return $this->uuid_name_cache[$uuid];
|
||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user